mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
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: 99624bdff8 ("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
This commit is contained in:
parent
39125eaf88
commit
556dba9547
|
|
@ -1572,6 +1572,7 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
|
|||
return 0;
|
||||
|
||||
err_unmap:
|
||||
svm_pages->flags.has_dma_mapping = true;
|
||||
__drm_gpusvm_unmap_pages(gpusvm, svm_pages, num_dma_mapped);
|
||||
drm_gpusvm_notifier_unlock(gpusvm);
|
||||
err_free:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user