[Intel-gfx] [PATCH] drm/i915/selftests: Fix wrong return value of perf_series_engines()

Mika Kuoppala mika.kuoppala at linux.intel.com
Mon Nov 16 14:51:19 UTC 2020


Zhang Xiaoxu <zhangxiaoxu5 at huawei.com> writes:

> If intel context create failed, the perf_series_engines() will return 0
> rather than error, because we doesn't initialize the return value.
>
> Fixes: cbfd3a0c5a55 ("drm/i915/selftests: Add request throughput measurement to perf")
> Reported-by: Hulk Robot <hulkci at huawei.com>
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5 at huawei.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>

> ---
>  drivers/gpu/drm/i915/selftests/i915_request.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
> index 6b512fc13ca7..e424a6d1a68c 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> @@ -2469,8 +2469,10 @@ static int perf_series_engines(void *arg)
>  		struct intel_context *ce;
>  
>  		ce = intel_context_create(engine);
> -		if (IS_ERR(ce))
> +		if (IS_ERR(ce)) {
> +			err = PTR_ERR(ce);
>  			goto out;
> +		}
>  
>  		err = intel_context_pin(ce);
>  		if (err) {
> -- 
> 2.25.4


More information about the Intel-gfx mailing list