drm/i915: Check before removing mm notifier
authorjsg <jsg@openbsd.org>
Thu, 4 Apr 2024 07:43:15 +0000 (07:43 +0000)
committerjsg <jsg@openbsd.org>
Thu, 4 Apr 2024 07:43:15 +0000 (07:43 +0000)
From Nirmoy Das
a30c36bc0cfc32ec3662408e6a5cdf8a809fde51 in linux-6.6.y/6.6.24
01bb1ae35006e473138c90711bad1a6b614a1823 in mainline linux

sys/dev/pci/drm/i915/gem/i915_gem_userptr.c

index 505ff30..94deec6 100644 (file)
@@ -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;
 }