Commit 401f147b authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Wilson
Browse files

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: 85fddf0b ("drm/i915: Introduce a context barrier callback")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321092451.GK2202@kadam
parent ab7529f2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}