diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-03-21 12:24:51 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-21 13:30:16 +0000 |
commit | 401f147b16d90ae378ec8218679e6fdba96e13cf (patch) | |
tree | bc4bd03dfc2d729fa6835d1206d72eb875cf0166 /drivers/gpu/drm/i915/selftests | |
parent | ab7529f2441791cdfe6c8e3202f35f3e811985a6 (diff) | |
download | linux-stable-401f147b16d90ae378ec8218679e6fdba96e13cf.tar.gz linux-stable-401f147b16d90ae378ec8218679e6fdba96e13cf.tar.bz2 linux-stable-401f147b16d90ae378ec8218679e6fdba96e13cf.zip |
drm/i915/selftests: fix NULL vs IS_ERR() check in mock_context_barrier()
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
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r-- | drivers/gpu/drm/i915/selftests/i915_gem_context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 4399ef9ebf15..a172dbd9cb9e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -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; } |