From: Colin Ian King Date: Thu, 18 May 2017 13:39:42 +0000 (+0100) Subject: drm/i915: Check C for null pointer rather than B X-Git-Tag: v5.15~10870^2~32^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac0a73fb526100adc521ec2069623e47ca3997a8;p=platform%2Fkernel%2Flinux-starfive.git drm/i915: Check C for null pointer rather than B There are two occasions where pointer B is being check for a NULL when it should be pointer C instead. Fix these. Detected by CoverityScan, CID#1436348,1436349 ("Logically Dead Code") Fixes: 47624cc3301b60 ("drm/i915: Import the kfence selftests for i915_sw_fence") Signed-off-by: Colin Ian King Link: http://patchwork.freedesktop.org/patch/msgid/20170518133942.5660-1-colin.king@canonical.com Signed-off-by: Chris Wilson --- diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c index 98baf10..c31d439 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -311,7 +311,7 @@ static int test_AB_C(void *arg) } C = alloc_fence(); - if (!B) { + if (!C) { ret = -ENOMEM; goto err_B; } @@ -388,7 +388,7 @@ static int test_C_AB(void *arg) } C = alloc_fence(); - if (!B) { + if (!C) { ret = -ENOMEM; goto err_B; }