]> Git Repo - linux.git/commitdiff
ieee802154/adf7242: check status of adf7242_read_reg
authorTom Rix <[email protected]>
Sun, 2 Aug 2020 14:23:39 +0000 (07:23 -0700)
committerStefan Schmidt <[email protected]>
Mon, 3 Aug 2020 18:19:21 +0000 (20:19 +0200)
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: 7302b9d90117 ("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]>
drivers/net/ieee802154/adf7242.c

index c11f32f644db3ce27a81d41c27593f5d3821d7e7..7db9cbd0f5ded13c96060d6b3ef5946db8b3fcd0 100644 (file)
@@ -882,7 +882,9 @@ static int adf7242_rx(struct adf7242_local *lp)
        int ret;
        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;
 
This page took 0.06503 seconds and 4 git commands to generate.