Skip to content

Commit 748b2f5

Browse files
harshimogalapalliStefan-Schmidt
authored andcommitted
ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
mac_len is of type unsigned, which can never be less than zero. mac_len = ieee802154_hdr_peek_addrs(skb, &header); if (mac_len < 0) return mac_len; Change this to type int as ieee802154_hdr_peek_addrs() can return negative integers, this is found by static analysis with smatch. Fixes: 6c99377 ("ca8210: fix mac_len negative array access") Signed-off-by: Harshit Mogalapalli <[email protected]> Acked-by: Alexander Aring <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stefan Schmidt <[email protected]>
1 parent cd35601 commit 748b2f5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/ieee802154/ca8210.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,10 +1902,9 @@ static int ca8210_skb_tx(
19021902
struct ca8210_priv *priv
19031903
)
19041904
{
1905-
int status;
19061905
struct ieee802154_hdr header = { };
19071906
struct secspec secspec;
1908-
unsigned int mac_len;
1907+
int mac_len, status;
19091908

19101909
dev_dbg(&priv->spi->dev, "%s called\n", __func__);
19111910

0 commit comments

Comments
 (0)