[Intel-gfx] [PATCH] drm/i915/selftests: fix some error codes in __cancel_reset()

Andi Shyti andi.shyti at linux.intel.com
Fri Feb 4 17:45:51 UTC 2022


Hi Dan,

> There were two error paths in __cancel_reset() which return success
> instead of a negative error code as expected.
> 
> Fixes: 4e6835466771 ("drm/i915/selftests: Add a cancel request selftest that triggers a reset")
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
> ---
> >From static analysis.  I am not 100% sure this.  Please review extra
> carefully!
> 
>  drivers/gpu/drm/i915/selftests/i915_request.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index 2a99dd7c2fe8..05e9f977757b 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -809,7 +809,8 @@ static int __cancel_reset(struct drm_i915_private *i915,
>  	preempt_timeout_ms = engine->props.preempt_timeout_ms;
>  	engine->props.preempt_timeout_ms = 100;
>  
> -	if (igt_spinner_init(&spin, engine->gt))
> +	err = igt_spinner_init(&spin, engine->gt);
> +	if (err)
>  		goto out_restore;
>  
>  	ce = intel_context_create(engine);
> @@ -838,8 +839,10 @@ static int __cancel_reset(struct drm_i915_private *i915,
>  	}
>  
>  	nop = intel_context_create_request(ce);
> -	if (IS_ERR(nop))
> +	if (IS_ERR(nop)) {
> +		err = PTR_ERR(nop);
>  		goto out_rq;
> +	}

Looks correct to me:

Reviewed-by: Andi Shyti <andi.shyti at linux.intel.com>

Thank you,
Andi


More information about the Intel-gfx mailing list