lkml.org 
[lkml]   [2023]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH next] ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx()
From
Hello Harshit.

On 06.03.23 20:18, Harshit Mogalapalli wrote:
> 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: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> Only compile tested.
> ---
> drivers/net/ieee802154/ca8210.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 0b0c6c0764fe..d0b5129439ed 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -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__);
>

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

I took the liberty and changed the fixes tag to the change that
introduced the resaon for the mismatch recently. As suggested by Simon.

regards
Stefan Schmidt

\
 
 \ /
  Last update: 2023-03-27 01:04    [W:0.079 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site