]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gpusvm: Fix unbalanced unlock in drm_gpusvm_scan_mm()
authorMaciej Patelczyk <maciej.patelczyk@intel.com>
Mon, 9 Feb 2026 12:34:33 +0000 (13:34 +0100)
committerMatthew Brost <matthew.brost@intel.com>
Tue, 10 Feb 2026 18:52:49 +0000 (10:52 -0800)
commitd287dee565c3c32e1ed76ec1847af46809c29b90
treeb7c25dc71ad05b678c0e4655d83f55215f20f3bb
parente04c609eedf4d6748ac0bcada4de1275b034fed6
drm/gpusvm: Fix unbalanced unlock in drm_gpusvm_scan_mm()

There is a unbalanced lock/unlock to gpusvm notifier lock:
[  931.045868] =====================================
[  931.046509] WARNING: bad unlock balance detected!
[  931.047149] 6.19.0-rc6+xe-**************** #9 Tainted: G     U
[  931.048150] -------------------------------------
[  931.048790] kworker/u5:0/51 is trying to release lock (&gpusvm->notifier_lock) at:
[  931.049801] [<ffffffffa090c0d8>] drm_gpusvm_scan_mm+0x188/0x460 [drm_gpusvm_helper]
[  931.050802] but there are no more locks to release!
[  931.051463]

The drm_gpusvm_notifier_unlock() sits under err_free label and the
first jump to err_free is just before calling the
drm_gpusvm_notifier_lock() causing unbalanced unlock.

Fixes: f1d08a586482 ("drm/gpusvm: Introduce a function to scan the current migration state")
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260209123433.1271053-1-maciej.patelczyk@intel.com
drivers/gpu/drm/drm_gpusvm.c