[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250331121344.0d4af6a7@jic23-huawei>
Date: Mon, 31 Mar 2025 12:13:44 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Matti Vaittinen <mazziesaccount@...il.com>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>, Lars-Peter Clausen
<lars@...afoo.de>, Rob Herring <robh@...nel.org>, Krzysztof Kozlowski
<krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Nuno Sa
<nuno.sa@...log.com>, David Lechner <dlechner@...libre.com>, Javier
Carrasco <javier.carrasco.cruz@...il.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/6] iio: adc: ti-adc128s052: Use devm_mutex_init()
On Mon, 31 Mar 2025 11:03:30 +0300
Matti Vaittinen <mazziesaccount@...il.com> wrote:
> Quoting Jonathan:
> "Whilst it doesn't bring huge advantage, now we have devm_mutex_init()
> it seems reasonable to use it and maybe catch a use after free for the
> lock"
>
> Switch to use devm_mutex_init() while working on this file.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>
> ---
> drivers/iio/adc/ti-adc128s052.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c
> index dd1e405bf172..90b23c68daea 100644
> --- a/drivers/iio/adc/ti-adc128s052.c
> +++ b/drivers/iio/adc/ti-adc128s052.c
> @@ -172,7 +172,7 @@ static int adc128_probe(struct spi_device *spi)
> if (ret)
> return ret;
>
> - mutex_init(&adc->lock);
> + devm_mutex_init(&spi->dev, &adc->lock);
ret = devm_mutex_init(&spi->dev, &adc->lock);
if (ret)
return ret;
>
> return devm_iio_device_register(&spi->dev, indio_dev);
> }
Powered by blists - more mailing lists