lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 3 Aug 2020 06:20:58 +0000
From:   "Hennerich, Michael" <Michael.Hennerich@...log.com>
To:     "trix@...hat.com" <trix@...hat.com>,
        "alex.aring@...il.com" <alex.aring@...il.com>,
        "stefan@...enfreihafen.org" <stefan@...enfreihafen.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "marcel@...tmann.org" <marcel@...tmann.org>
CC:     "linux-wpan@...r.kernel.org" <linux-wpan@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] ieee802154/adf7242: check status of adf7242_read_reg



> -----Original Message-----
> From: trix@...hat.com <trix@...hat.com>
> Sent: Sonntag, 2. August 2020 16:24
> To: Hennerich, Michael <Michael.Hennerich@...log.com>;
> alex.aring@...il.com; stefan@...enfreihafen.org; davem@...emloft.net;
> kuba@...nel.org; marcel@...tmann.org
> Cc: linux-wpan@...r.kernel.org; netdev@...r.kernel.org; linux-
> kernel@...r.kernel.org; Tom Rix <trix@...hat.com>
> Subject: [PATCH] ieee802154/adf7242: check status of adf7242_read_reg
> 
> 
> From: Tom Rix <trix@...hat.com>
> 
> 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 <trix@...hat.com>

Acked-by: Michael Hennerich <michael.hennerich@...log.com>

> ---
>  drivers/net/ieee802154/adf7242.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/adf7242.c
> b/drivers/net/ieee802154/adf7242.c
> index c11f32f644db..7db9cbd0f5de 100644
> --- a/drivers/net/ieee802154/adf7242.c
> +++ b/drivers/net/ieee802154/adf7242.c
> @@ -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;
> 
> --
> 2.18.1

Powered by blists - more mailing lists