Skip to content

Commit

Permalink
drm/i915: Check before removing mm notifier
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nirmoy authored and tursulin committed Feb 28, 2024
1 parent 5cf0fbf commit db7bbd1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/gem/i915_gem_userptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit db7bbd1

Please sign in to comment.