[Intel-gfx] [PATCH] drm/i915/selftests: Fix an IS_ERR() vs NULL check

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Mar 26 09:30:57 UTC 2019


Dan Carpenter <dan.carpenter at oracle.com> writes:

> The live_context() function returns error pointers.  It never returns
> NULL.
>
> Fixes: 9c1477e83e62 ("drm/i915/selftests: Exercise adding requests to a full GGTT")
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

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

i915_request.c has another :)

-Mika

> ---
>  drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> index 9a9451846b33..89766688e420 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c
> @@ -455,7 +455,7 @@ static int igt_evict_contexts(void *arg)
>  			struct i915_gem_context *ctx;
>  
>  			ctx = live_context(i915, file);
> -			if (!ctx)
> +			if (IS_ERR(ctx))
>  				break;
>  
>  			/* We will need some GGTT space for the rq's context */
> -- 
> 2.17.1


More information about the Intel-gfx mailing list