[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66b5c2fc7a0ae_133d370b6@njaxe.notmuch>
Date: Fri, 09 Aug 2024 09:19:24 +0200
From: Matteo Martelli <matteomartelli3@...il.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Matteo Martelli <matteomartelli3@...il.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] iio: adc: pac1921: add missing error return in probe()
Dan Carpenter wrote:
> This error path was intended to return, and not just print an error. The
> current code will lead to an error pointer dereference.
>
> Fixes: 371f778b83cd ("iio: adc: add support for pac1921")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> drivers/iio/adc/pac1921.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c
> index d04c6685d780..8200a47bdf21 100644
> --- a/drivers/iio/adc/pac1921.c
> +++ b/drivers/iio/adc/pac1921.c
> @@ -1168,8 +1168,8 @@ static int pac1921_probe(struct i2c_client *client)
>
> priv->regmap = devm_regmap_init_i2c(client, &pac1921_regmap_config);
> if (IS_ERR(priv->regmap))
> - dev_err_probe(dev, (int)PTR_ERR(priv->regmap),
> - "Cannot initialize register map\n");
> + return dev_err_probe(dev, (int)PTR_ERR(priv->regmap),
> + "Cannot initialize register map\n");
>
> devm_mutex_init(dev, &priv->lock);
>
> --
> 2.43.0
>
The intent was indeed to return the error. Thanks for catching it.
Acked-by: Matteo Martelli <matteomartelli3@...il.com>
Thanks,
Matteo Martelli
Powered by blists - more mailing lists