Skip to content

Commit 01bb1ae

Browse files
nirmoyjlahtine-intel
authored andcommitted
drm/i915: Check before removing mm notifier
Error in mmu_interval_notifier_insert() can leave a NULL notifier.mm pointer. Catch that and return early. Fixes: ed29c26 ("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]> (cherry picked from commit db7bbd1) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent e567857 commit 01bb1ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/i915/gem/i915_gem_userptr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ i915_gem_userptr_release(struct drm_i915_gem_object *obj)
379379
{
380380
GEM_WARN_ON(obj->userptr.page_ref);
381381

382+
if (!obj->userptr.notifier.mm)
383+
return;
384+
382385
mmu_interval_notifier_remove(&obj->userptr.notifier);
383386
obj->userptr.notifier.mm = NULL;
384387
}

0 commit comments

Comments
 (0)