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] [day] [month] [year] [list]
Message-ID: <20250611175559.76fb1365@jic23-huawei>
Date: Wed, 11 Jun 2025 17:55:59 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Michael Hennerich <Michael.Hennerich@...log.com>, Nuno Sá
 <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: ad7173: check return value of spi_setup()

On Wed, 11 Jun 2025 09:40:16 -0500
David Lechner <dlechner@...libre.com> wrote:

> Check the return value of spi_setup() and propagate the error in the
> ad7173_probe() function. This is unlikely to happen since virtually
> every SPI controller supports SPI_MODE_3, but still always a good idea
> to check the return value.
> 
> Signed-off-by: David Lechner <dlechner@...libre.com>
Applied.

> ---
>  drivers/iio/adc/ad7173.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index 69de5886474ce2f700bf277ce707b15637113564..911001be368302fb9d7d6e8da3783751fe0f61c5 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -1775,7 +1775,9 @@ static int ad7173_probe(struct spi_device *spi)
>  	indio_dev->info = &ad7173_info;
>  
>  	spi->mode = SPI_MODE_3;
> -	spi_setup(spi);
> +	ret = spi_setup(spi);
> +	if (ret)
> +		return ret;
>  
>  	ret = ad_sd_init(&st->sd, indio_dev, spi, st->info->sd_info);
>  	if (ret)
> 
> ---
> base-commit: aff301f37e220970c2f301b5c65a8bfedf52058e
> change-id: 20250611-iio-adc-ad7173-check-spi_setup-return-072017235f3c
> 
> Best regards,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ