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  linux-cve-announce  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]
Message-ID: <f2c6d3f3f8f884e87f1c9895fe99b77e8f4c1e3e.camel@analog.com>
Date:   Fri, 24 Apr 2020 15:01:26 +0000
From:   "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To:     "lars@...afoo.de" <lars@...afoo.de>,
        "linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
        "Bogdan, Dragos" <Dragos.Bogdan@...log.com>,
        "pmeerw@...erw.net" <pmeerw@...erw.net>,
        "knaack.h@....de" <knaack.h@....de>,
        "colin.king@...onical.com" <colin.king@...onical.com>,
        "Hennerich, Michael" <Michael.Hennerich@...log.com>,
        "jic23@...nel.org" <jic23@...nel.org>
CC:     "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH][next] iio: adc: ad7476: remove redundant null check on an
 array

On Fri, 2020-04-24 at 14:04 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> The null check on st->chip_info->convst_channel is redundant because
> convst_channel is a 2 element array of struct iio_chan_spec objects
> and this can never be null. Fix this by removing the null check.
> 

Reviewed-by: Alexandru Ardelean <alexandru.ardelean@...log.com>

> Addresses-Coverity: ("Array compared against 0")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  drivers/iio/adc/ad7476.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
> index e9984a38fc4c..4e816d714ad2 100644
> --- a/drivers/iio/adc/ad7476.c
> +++ b/drivers/iio/adc/ad7476.c
> @@ -309,7 +309,7 @@ static int ad7476_probe(struct spi_device *spi)
>  	indio_dev->num_channels = 2;
>  	indio_dev->info = &ad7476_info;
>  
> -	if (st->convst_gpio && st->chip_info->convst_channel)
> +	if (st->convst_gpio)
>  		indio_dev->channels = st->chip_info->convst_channel;
>  	/* Setup default message */
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ