Skip to content

Commit 401f147

Browse files
Dan Carpenterickle
authored andcommitted
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: 85fddf0 ("drm/i915: Introduce a context barrier callback") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20190321092451.GK2202@kadam
1 parent ab7529f commit 401f147

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/selftests/i915_gem_context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,8 @@ static int mock_context_barrier(void *arg)
16201620
mutex_lock(&i915->drm.struct_mutex);
16211621

16221622
ctx = mock_context(i915, "mock");
1623-
if (IS_ERR(ctx)) {
1624-
err = PTR_ERR(ctx);
1623+
if (!ctx) {
1624+
err = -ENOMEM;
16251625
goto unlock;
16261626
}
16271627

0 commit comments

Comments
 (0)