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