From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
dri-devel@lists.freedesktop.org
Subject: [PATCH 1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks
Date: Fri, 2 Jul 2021 11:46:41 +0100 [thread overview]
Message-ID: <20210702104642.1189978-1-matthew.auld@intel.com> (raw)
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
next reply other threads:[~2021-07-02 10:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 10:46 Matthew Auld [this message]
2021-07-02 10:46 ` [PATCH 2/2] drm/i915/selftests: fix smatch warning in mock_reserve Matthew Auld
2021-07-06 9:43 ` Ramalingam C
2021-07-06 9:39 ` [PATCH 1/2] drm/i915/selftests: fix smatch warning in igt_check_blocks Ramalingam C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210702104642.1189978-1-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox