drm/gpuvm: Do not prepare NULL objects
authorJonathan Cavitt <jonathan.cavitt@intel.com>
Fri, 30 Jan 2026 19:19:54 +0000 (19:19 +0000)
committerJonathan Cavitt <jonathan.cavitt@intel.com>
Thu, 16 Apr 2026 18:27:17 +0000 (02:27 +0800)
commit88f059f6f6f589bd78e2ceb05a1339a8c10b8626
tree501b4217099a5960ea11ca3d7c0097c14c1f0285
parent432fafdc9a3122a7bee5b2bfd23dcf2dc262a3d7
drm/gpuvm: Do not prepare NULL objects

Statis analysis issue:

drm_gpuvm_prepare_range issues an exec_object_prepare call to all
drm_gem_objects mapped between addr and addr + range.  However, it is
possible (albeit very unlikely) that the objects found through
drm_gpuvm_for_each_va_range (as connected to va->gem) are NULL, as seen
in other functions such as drm_gpuva_link and drm_gpuva_unlink_defer.

Do not prepare NULL objects.

Fixes: 50c1a36f594b ("drm/gpuvm: track/lock/validate external/evicted objects")
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Link: https://patch.msgid.link/20260130191953.61718-2-jonathan.cavitt@intel.com
drivers/gpu/drm/drm_gpuvm.c