Commit 39c96742 authored by Tom Rix's avatar Tom Rix Committed by Greg Kroah-Hartman

ieee802154/adf7242: check status of adf7242_read_reg

[ Upstream commit e3914ed6 ]

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: 7302b9d9 ("ieee802154/adf7242: Driver for ADF7242 MAC IEEE802154")
Signed-off-by: default avatarTom Rix <trix@redhat.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20200802142339.21091-1-trix@redhat.comSigned-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0ce70ef5
...@@ -834,7 +834,9 @@ static int adf7242_rx(struct adf7242_local *lp) ...@@ -834,7 +834,9 @@ static int adf7242_rx(struct adf7242_local *lp)
int ret; int ret;
u8 lqi, len_u8, *data; u8 lqi, len_u8, *data;
adf7242_read_reg(lp, 0, &len_u8); ret = adf7242_read_reg(lp, 0, &len_u8);
if (ret)
return ret;
len = len_u8; len = len_u8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment