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

Dan Carpenter
2021-02-15T15:58:27Z

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(+)

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);
--
2.30.0