On 1/4/2022 09:31, Matthew Brost wrote:
intel_context_timeline_lock can return can error if interrupted by a
user when trying to lock the timeline mutex. Check the return value of
intel_context_timeline_lock in eb_pin_timeline (execbuf IOCTL).
Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf")
Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx>
---
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index e9541244027a..65a078945b00 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2517,6 +2517,9 @@ static int eb_pin_timeline(struct i915_execbuffer *eb, struct intel_context *ce,
i915_request_put(rq);
tl = intel_context_timeline_lock(ce);
+ if (IS_ERR(tl))
+ return PTR_ERR(tl);
+
intel_context_exit(ce);
Won't this leak the stuff acquired by the intel_context_enter() above if
the _exit() is now skipped?
John.
intel_context_timeline_unlock(tl);