Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks
@ 2021-07-02 10:46 Matthew Auld
  2021-07-02 10:46 ` [Intel-gfx] [PATCH 2/2] drm/i915/selftests: fix smatch warning in mock_reserve Matthew Auld
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Auld @ 2021-07-02 10:46 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dan Carpenter, dri-devel

The block here can't be NULL, especially since we already dereferenced
it earlier, so remove the redundant check.

igt_check_blocks() warn: variable dereferenced before check 'block' (see line 126)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_buddy.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_buddy.c b/drivers/gpu/drm/i915/selftests/i915_buddy.c
index f0f5c4df8dbc..d61ec9c951bf 100644
--- a/drivers/gpu/drm/i915/selftests/i915_buddy.c
+++ b/drivers/gpu/drm/i915/selftests/i915_buddy.c
@@ -166,10 +166,8 @@ static int igt_check_blocks(struct i915_buddy_mm *mm,
 		igt_dump_block(mm, prev);
 	}
 
-	if (block) {
-		pr_err("bad block, dump:\n");
-		igt_dump_block(mm, block);
-	}
+	pr_err("bad block, dump:\n");
+	igt_dump_block(mm, block);
 
 	return err;
 }
-- 
2.26.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-06  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-02 10:46 [Intel-gfx] [PATCH 1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks Matthew Auld
2021-07-02 10:46 ` [Intel-gfx] [PATCH 2/2] drm/i915/selftests: fix smatch warning in mock_reserve Matthew Auld
2021-07-06  9:43   ` Ramalingam C
2021-07-02 11:12 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks Patchwork
2021-07-02 11:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-02 14:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-06  9:39 ` [Intel-gfx] [PATCH 1/2] " Ramalingam C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox