[Intel-gfx] [PATCH] drm/i915: Check return intel_context_timeline_lock of in eb_pin_timeline

Matthew Brost matthew.brost at intel.com
Tue Jan 4 17:31:00 UTC 2022


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 at intel.com>
---
 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);
 			intel_context_timeline_unlock(tl);
 
-- 
2.34.1



More information about the Intel-gfx mailing list