Skip to contentSkip to conversation

FAILED: Patch "drm/i915: Check before removing mm notifier" failed to apply to 6.1-stable tree

PATCH Sasha Levin 1 participant 1 message Mar 27, 2024

Subsystems (3)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From db7bbd13f08774cde0332c705f042e327fe21e73 Mon Sep 17 00:00:00 2001
From: Nirmoy Das <[email protected]>
Date: Mon, 19 Feb 2024 13:50:47 +0100
Subject: [PATCH] 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 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]>
---
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_userptr.c +3 -0
index 0e21ce9d3e5ac..61abfb505766d 100644
@@ -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;
 }
Signature · 1 line
2.43.0