]> Git Repo - linux.git/commitdiff
drm/i915: Check before removing mm notifier
authorNirmoy Das <[email protected]>
Mon, 19 Feb 2024 12:50:47 +0000 (13:50 +0100)
committerTvrtko Ursulin <[email protected]>
Wed, 28 Feb 2024 13:11:32 +0000 (13:11 +0000)
Error in mmu_interval_notifier_insert() can leave a NULL
notifier.mm pointer. Catch that and return early.

Fixes: ed29c2691188 ("drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7.")
Cc: <[email protected]> # v5.13+
[tursulin: Added Fixes and cc stable.]
Cc: Andi Shyti <[email protected]>
Cc: Shawn Lee <[email protected]>
Signed-off-by: Nirmoy Das <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Tvrtko Ursulin <[email protected]>
drivers/gpu/drm/i915/gem/i915_gem_userptr.c

index 0e21ce9d3e5ac04377cb385a2f5a1893e8b1b19b..61abfb505766d62907b8512913069be337be8b00 100644 (file)
@@ -349,6 +349,9 @@ i915_gem_userptr_release(struct drm_i915_gem_object *obj)
 {
        GEM_WARN_ON(obj->userptr.page_ref);
 
+       if (!obj->userptr.notifier.mm)
+               return;
+
        mmu_interval_notifier_remove(&obj->userptr.notifier);
        obj->userptr.notifier.mm = NULL;
 }
This page took 0.059169 seconds and 4 git commands to generate.