All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fixup userptr mmu notifier registration error handling
@ 2017-10-17 14:14 Daniel Vetter
  2017-10-17 15:09 ` [PATCH v2] " Tvrtko Ursulin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Daniel Vetter @ 2017-10-17 14:14 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, Dan Carpenter

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@oracle.com>
Fixes: 7741b547b6e0 ("drm/i915: Preallocate our mmu notifier workequeu to unbreak cpu hotplug deadlock")
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-10-18  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 14:14 [PATCH] drm/i915: Fixup userptr mmu notifier registration error handling Daniel Vetter
2017-10-17 15:09 ` [PATCH v2] " Tvrtko Ursulin
2017-10-17 15:32   ` Chris Wilson
2017-10-18  9:07   ` Daniel Vetter
2017-10-18  9:39     ` Tvrtko Ursulin
2017-10-17 15:12 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-17 16:07 ` ✓ Fi.CI.BAT: success for drm/i915: Fixup userptr mmu notifier registration error handling (rev2) Patchwork
2017-10-18  8:26   ` Tvrtko Ursulin
2017-10-18  2:37 ` ✗ Fi.CI.IGT: warning " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.