drm/i915/selftests: Fix an IS_ERR() vs NULL check
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 26 Mar 2019 05:08:43 +0000 (08:08 +0300)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 26 Mar 2019 14:53:01 +0000 (14:53 +0000)
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@oracle.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190326050843.GA20038@kadam
drivers/gpu/drm/i915/selftests/i915_gem_evict.c

index 9a9451846b33f5fae1fc6fdbc0baadb32a59ff94..89766688e420c28c6d517ed308c3f88063771ae2 100644 (file)
@@ -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 */