Skip to content

Commit e3914ed

Browse files
Tom RixStefan-Schmidt
authored andcommitted
ieee802154/adf7242: check status of adf7242_read_reg
Clang static analysis reports this error adf7242.c:887:6: warning: Assigned value is garbage or undefined len = len_u8; ^ ~~~~~~ len_u8 is set in adf7242_read_reg(lp, 0, &len_u8); When this call fails, len_u8 is not set. So check the return code. Fixes: 7302b9d ("ieee802154/adf7242: Driver for ADF7242 MAC IEEE802154") Signed-off-by: Tom Rix <[email protected]> Acked-by: Michael Hennerich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent 88f46b3 commit e3914ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ieee802154/adf7242.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,9 @@ static int adf7242_rx(struct adf7242_local *lp)
882882
int ret;
883883
u8 lqi, len_u8, *data;
884884

885-
adf7242_read_reg(lp, 0, &len_u8);
885+
ret = adf7242_read_reg(lp, 0, &len_u8);
886+
if (ret)
887+
return ret;
886888

887889
len = len_u8;
888890

0 commit comments

Comments
 (0)