diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c index c31d439fae3a..19d145d6bf52 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -123,6 +123,11 @@ static int test_dag(void *arg) } C = alloc_fence(); + if (!C) { + ret = -ENOMEM; + goto err_B; + } + if (i915_sw_fence_await_sw_fence_gfp(B, C, GFP_KERNEL) == -EINVAL) { pr_err("invalid cycle detected\n"); goto err_C;