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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250818192337.2256ff4a@jic23-huawei>
Date: Mon, 18 Aug 2025 19:23:37 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Salah Triki <salah.triki@...il.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
 dlechner@...libre.com, nuno.sa@...log.com, andy@...nel.org,
 Markus.Elfring@....de
Subject: Re: [PATCH v4 1/3] iio: pressure: bmp280: Use IS_ERR() in
 bmp280_common_probe()

On Mon, 18 Aug 2025 10:27:30 +0100
Salah Triki <salah.triki@...il.com> wrote:

> `devm_gpiod_get_optional()` may return non-NULL error pointer on failure.
> Check its return value using `IS_ERR()` and propagate the error if
> necessary.
> 
> Fixes: df6e71256c84 ("iio: pressure: bmp280: Explicitly mark GPIO optional")
> Cc: David Lechner <dlechner@...libre.com>
> Cc: Jonathan Cameron <jic23@...nel.org>
> Cc: Andy Shevchenko <andy@...nel.org>
> Cc: Nuno Sá <nuno.sa@...log.com>
> Cc: Markus Elfring <Markus.Elfring@....de>
> Signed-off-by: Salah Triki <salah.triki@...il.com>
> Reviewed-by: David Lechner <dlechner@...libre.com>

Applied to the fixes-togreg branch of iio.git and marked for stable.

The rest of the series will have to wait for that to work it's way back
via upstream. 

Thanks

Jonathan

> ---
>  drivers/iio/pressure/bmp280-core.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index 74505c9ec1a0..6cdc8ed53520 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -3213,11 +3213,12 @@ int bmp280_common_probe(struct device *dev,
>  
>  	/* Bring chip out of reset if there is an assigned GPIO line */
>  	gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> +	if (IS_ERR(gpiod))
> +		return dev_err_probe(dev, PTR_ERR(gpiod), "failed to get reset GPIO\n");
> +
>  	/* Deassert the signal */
> -	if (gpiod) {
> -		dev_info(dev, "release reset\n");
> -		gpiod_set_value(gpiod, 0);
> -	}
> +	dev_info(dev, "release reset\n");
> +	gpiod_set_value(gpiod, 0);
>  
>  	data->regmap = regmap;
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ