wifi: iwlwifi: fw: move memset before early return
[ Upstream commit 8ce437dd5b2e4adef13aa4ecce07392f9966b1ab ]
Clang static analysis reports this representative issue
dbg.c:1455:6: warning: Branch condition evaluates to
a garbage value
if (!rxf_data.size)
^~~~~~~~~~~~~~
This check depends on iwl_ini_get_rxf_data() to clear
rxf_data but the function can return early without
doing the clear. So move the memset before the early
return.
Fixes: cc9b6012d3
("iwlwifi: yoyo: use hweight_long instead of bit manipulating")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230414130637.872a7175f1ff.I33802a77a91998276992b088fbe25f61c87c33ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c0ca382419
commit
038cbab550
@ -1372,13 +1372,13 @@ static void iwl_ini_get_rxf_data(struct iwl_fw_runtime *fwrt,
|
|||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
memset(data, 0, sizeof(*data));
|
||||||
|
|
||||||
/* make sure only one bit is set in only one fid */
|
/* make sure only one bit is set in only one fid */
|
||||||
if (WARN_ONCE(hweight_long(fid1) + hweight_long(fid2) != 1,
|
if (WARN_ONCE(hweight_long(fid1) + hweight_long(fid2) != 1,
|
||||||
"fid1=%x, fid2=%x\n", fid1, fid2))
|
"fid1=%x, fid2=%x\n", fid1, fid2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memset(data, 0, sizeof(*data));
|
|
||||||
|
|
||||||
if (fid1) {
|
if (fid1) {
|
||||||
fifo_idx = ffs(fid1) - 1;
|
fifo_idx = ffs(fid1) - 1;
|
||||||
if (WARN_ONCE(fifo_idx >= MAX_NUM_LMAC, "fifo_idx=%d\n",
|
if (WARN_ONCE(fifo_idx >= MAX_NUM_LMAC, "fifo_idx=%d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user