mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
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: 6c993779ea
("ca8210: fix mac_len negative array access")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230306191824.4115839-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
This commit is contained in:
parent
cd356010ce
commit
748b2f5e82
1 changed files with 1 additions and 2 deletions
|
@ -1902,10 +1902,9 @@ static int ca8210_skb_tx(
|
|||
struct ca8210_priv *priv
|
||||
)
|
||||
{
|
||||
int status;
|
||||
struct ieee802154_hdr header = { };
|
||||
struct secspec secspec;
|
||||
unsigned int mac_len;
|
||||
int mac_len, status;
|
||||
|
||||
dev_dbg(&priv->spi->dev, "%s called\n", __func__);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue