summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-04 07:43:16 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-04 07:43:16 +0000
commit767e77fce1f9ef6b6fdba0745b626d16c5562f1e (patch)
treecc2736307ef84b8bae6ee25fd2a847c850793031
parentab0fc7a66e37d96ea389e4314da55553965d1421 (diff)
drm/i915: Check before removing mm notifier
From Nirmoy Das a30c36bc0cfc32ec3662408e6a5cdf8a809fde51 in linux-6.6.y/6.6.24 01bb1ae35006e473138c90711bad1a6b614a1823 in mainline linux
-rw-r--r--sys/dev/pci/drm/i915/gem/i915_gem_userptr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_userptr.c b/sys/dev/pci/drm/i915/gem/i915_gem_userptr.c
index 505ff3071bc..94deec64b13 100644
--- a/sys/dev/pci/drm/i915/gem/i915_gem_userptr.c
+++ b/sys/dev/pci/drm/i915/gem/i915_gem_userptr.c
@@ -379,6 +379,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;
}