]> git.hungrycats.org Git - linux/commit
drm/xe/userptr: Drop bogus static from finish in force_invalidate
authorShuicheng Lin <shuicheng.lin@intel.com>
Thu, 25 Jun 2026 22:44:52 +0000 (22:44 +0000)
committerShuicheng Lin <shuicheng.lin@intel.com>
Mon, 29 Jun 2026 21:56:32 +0000 (14:56 -0700)
commited382e3b07fae51a09d7290485bff0592f6b168b
tree5294c4fdf3e52394662c86da5cf239c5b95df5fe
parent80ccbd97ffee8ad2e73167d826fe7be548364365
drm/xe/userptr: Drop bogus static from finish in force_invalidate

The local "finish" pointer in xe_vma_userptr_force_invalidate() is
unconditionally written before each read, so the static storage class
serves no purpose. Worse, it makes the variable a process-wide shared
slot: the function's per-VM asserts do not exclude concurrent callers
on different VMs, so two such callers can race on the slot and take
the wrong if (finish) branch.

The function is gated by CONFIG_DRM_XE_USERPTR_INVAL_INJECT
(developer/test option, default n), so production builds are
unaffected.

Drop the static.

Fixes: 18c4e536959e ("drm/xe/userptr: Convert invalidation to two-pass MMU notifier")
Assisted-by: Claude:claude-opus-4.7
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Zongyao Bai <zongyao.bai@intel.com>
Link: https://patch.msgid.link/20260625224452.3243231-1-shuicheng.lin@intel.com
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
drivers/gpu/drm/xe/xe_userptr.c