[PATCH] drm/i915: Fixup userptr mmu notifier registration error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



One of the original patches got this right, but then in an attempt to
make the error handling more correct it got worse. Try again.

The problem here is that we clear err to 0 when mm->mn != NULL, which
will then leak the workqueue

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Fixes: 7741b547b6e0 ("drm/i915: Preallocate our mmu notifier workequeu to unbreak cpu hotplug deadlock")
Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_gem_userptr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c
index 4d712a4db63b..d3df780ee581 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -209,8 +209,10 @@ i915_mmu_notifier_find(struct i915_mm_struct *mm)
 		return mn;
 
 	mn = i915_mmu_notifier_create(mm->mm);
-	if (IS_ERR(mn))
+	if (IS_ERR(mn)) {
 		err = PTR_ERR(mn);
+		mn = NULL;
+	}
 
 	down_write(&mm->mm->mmap_sem);
 	mutex_lock(&mm->i915->mm_lock);
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux