diff mbox series

drm/i915/selftest: Fix an error code in mock_context_barrier()

Message ID YCqaI95UW9L7Mg/L@mwanda (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftest: Fix an error code in mock_context_barrier() | expand

Commit Message

Dan Carpenter Feb. 15, 2021, 3:58 p.m. UTC
If the igt_request_alloc() call fails then this should return a
negative error code, but currently it returns success.

Fixes: 85fddf0b0027 ("drm/i915: Introduce a context barrier callback")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Wilson Feb. 15, 2021, 4:35 p.m. UTC | #1
Quoting Dan Carpenter (2021-02-15 15:58:27)
> If the igt_request_alloc() call fails then this should return a
> negative error code, but currently it returns success.
> 
> Fixes: 85fddf0b0027 ("drm/i915: Introduce a context barrier callback")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Looks to be the only missing one in that file; smatch will no doubt find
more.
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
index d3f87dc4eda3..c30b583522ca 100644
--- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
@@ -1942,6 +1942,7 @@  static int mock_context_barrier(void *arg)
 	rq = igt_request_alloc(ctx, i915->gt.engine[RCS0]);
 	if (IS_ERR(rq)) {
 		pr_err("Request allocation failed!\n");
+		err = PTR_ERR(rq);
 		goto out;
 	}
 	i915_request_add(rq);