drm/i915/selftests: fix NULL vs IS_ERR() check in mock_context_barrier()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 21 Mar 2019 09:24:51 +0000 (12:24 +0300)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 21 Mar 2019 13:30:16 +0000 (13:30 +0000)
The mock_context() function returns NULL on error, it doesn't return
error pointers.

Fixes: 85fddf0b0027 ("drm/i915: Introduce a context barrier callback")
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/20190321092451.GK2202@kadam
drivers/gpu/drm/i915/selftests/i915_gem_context.c

index 4399ef9ebf1583c480a5f84a8170f2fe191fc8ce..a172dbd9cb9e49c86d82a8a782e7df486a66d0a8 100644 (file)
@@ -1620,8 +1620,8 @@ static int mock_context_barrier(void *arg)
        mutex_lock(&i915->drm.struct_mutex);
 
        ctx = mock_context(i915, "mock");
-       if (IS_ERR(ctx)) {
-               err = PTR_ERR(ctx);
+       if (!ctx) {
+               err = -ENOMEM;
                goto unlock;
        }