Skip to content

Commit

Permalink
drm/i915/selftests: fix NULL vs IS_ERR() check in mock_context_barrier()
Browse files Browse the repository at this point in the history
The mock_context() function returns NULL on error, it doesn't return
error pointers.

Fixes: 85fddf0 ("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
  • Loading branch information
Dan Carpenter authored and ickle committed Mar 21, 2019
1 parent ab7529f commit 401f147
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/selftests/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 401f147

Please sign in to comment.