From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Gustavo Bastos" <gustavobastos@usp.br>,
"Andrew Ijano" <andrew.ijano@gmail.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org,
error27@gmail.com
Subject: Re: [PATCH] iio: sca3000: Fix a resource leak in sca3000_probe()
Date: Wed, 28 Jan 2026 12:45:09 +0530 [thread overview]
Message-ID: <3d75cb8e-456a-4de4-808d-7ca5196800ea@oracle.com> (raw)
In-Reply-To: <20260128064953.2952714-1-harshit.m.mogalapalli@oracle.com>
Hi,
On 28/01/26 12:19, Harshit Mogalapalli wrote:
> spi->irq from request_threaded_irq() not released when
> iio_device_register() fails. Add an return value check and jump to a
> common error handler when iio_device_register() fails.
>
> Fixes: 9a4936dc89a3 ("staging:iio:accel:sca3000 Tidy up probe order to avoid a race.")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
Missed informing about how it was found.
Only compile tested, found with smatch.
> drivers/iio/accel/sca3000.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index bfa8a3f5a92f..9ef4d6e27466 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -1489,7 +1489,11 @@ static int sca3000_probe(struct spi_device *spi)
> if (ret)
> goto error_free_irq;
>
> - return iio_device_register(indio_dev);
> + ret = iio_device_register(indio_dev);
> + if (ret)
> + goto error_free_irq;
> +
> + return 0;
>
> error_free_irq:
> if (spi->irq)
next prev parent reply other threads:[~2026-01-28 7:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 6:49 [PATCH] iio: sca3000: Fix a resource leak in sca3000_probe() Harshit Mogalapalli
2026-01-28 7:15 ` Harshit Mogalapalli [this message]
2026-01-28 9:48 ` Andy Shevchenko
2026-01-28 14:45 ` Harshit Mogalapalli
2026-01-29 18:24 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d75cb8e-456a-4de4-808d-7ca5196800ea@oracle.com \
--to=harshit.m.mogalapalli@oracle.com \
--cc=andrew.ijano@gmail.com \
--cc=andy@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dlechner@baylibre.com \
--cc=error27@gmail.com \
--cc=gustavobastos@usp.br \
--cc=jic23@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox