Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/gpusvm: Force unmapping on error in drm_gpusvm_get_pages

drm_gpusvm_get_pages() only sets the local flags prior to committing the
pages. If an error occurs mid-mapping, has_dma_mapping will be clear,
causing the unmap function to skip unmapping pages that were
successfully mapped before the error. Fix this by forcibly setting
has_dma_mapping in the error path to ensure all previously mapped pages
are properly unmapped.

Fixes: 99624bdff867 ("drm/gpusvm: Add support for GPU Shared Virtual Memory")
Cc: stable@vger.kernel.org
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Link: https://patch.msgid.link/20260130194928.3255613-2-matthew.brost@intel.com

+1
+1
drivers/gpu/drm/drm_gpusvm.c
··· 1572 1572 return 0; 1573 1573 1574 1574 err_unmap: 1575 + svm_pages->flags.has_dma_mapping = true; 1575 1576 __drm_gpusvm_unmap_pages(gpusvm, svm_pages, num_dma_mapped); 1576 1577 drm_gpusvm_notifier_unlock(gpusvm); 1577 1578 err_free: