From: Chris Wilson Date: Tue, 15 Jan 2019 22:11:18 +0000 (+0000) Subject: drm/i915/userptr: Fix error handling of mutex_lock_killable() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9e267d286af5c5a67995128df40ca3d1f93277a6;p=linux.git drm/i915/userptr: Fix error handling of mutex_lock_killable() mutex_lock_killable() returns -EINTR on failure, not the anticipate bool return like trylock. (Oh no, not again.) Fixes: 484d9a844d0d ("drm/i915/userptr: Avoid struct_mutex recursion for mmu_invalidate_range_start") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20190115221118.13304-1-chris@chris-wilson.co.uk Reviewed-by: Matthew Auld --- diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c index 38e19a42e0f44..1d3f9a31ad619 100644 --- a/drivers/gpu/drm/i915/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/i915_gem_userptr.c @@ -150,7 +150,7 @@ userptr_mn_invalidate_range_start(struct mmu_notifier *_mn, switch (mutex_trylock_recursive(unlock)) { default: case MUTEX_TRYLOCK_FAILED: - if (!mutex_lock_killable_nested(unlock, I915_MM_SHRINKER)) { + if (mutex_lock_killable_nested(unlock, I915_MM_SHRINKER)) { i915_gem_object_put(obj); return -EINTR; }