From: Jonathan Cameron <jic23@kernel.org>
To: Felix Gu <ustc.gu@gmail.com>
Cc: "Francesco Dolcini" <francesco@dolcini.it>,
"João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Francesco Dolcini" <francesco.dolcini@toradex.com>,
"João Paulo Gonçalves" <joao.goncalves@toradex.com>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ti-ads1119: Fix unbalanced pm reference count in ds1119_single_conversion()
Date: Sat, 28 Feb 2026 11:25:59 +0000 [thread overview]
Message-ID: <20260228112559.03ec989c@jic23-huawei> (raw)
In-Reply-To: <20260228-ads1119-v1-1-e16825ce34af@gmail.com>
On Sat, 28 Feb 2026 01:48:19 +0800
Felix Gu <ustc.gu@gmail.com> wrote:
> In ads1119_single_conversion(), if pm_runtime_resume_and_get() fails,
> the code jumps to the pdown label, which calls
> pm_runtime_put_autosuspend().
>
> Since pm_runtime_resume_and_get() automatically decrements the usage
> counter on failure, the subsequent call to pm_runtime_put_autosuspend()
> causes an unbalanced reference counter.
>
> Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Hi Felix,
Looks correct to me. Applied to the fixes-togreg branch of iio.git and
pushed out as testing.
More eyes always welcome though if others have time to take a look.
Jonathan
> ---
> drivers/iio/adc/ti-ads1119.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
> index c9cedc59cdcd..4454f28b2b58 100644
> --- a/drivers/iio/adc/ti-ads1119.c
> +++ b/drivers/iio/adc/ti-ads1119.c
> @@ -274,7 +274,7 @@ static int ads1119_single_conversion(struct ads1119_state *st,
>
> ret = pm_runtime_resume_and_get(dev);
> if (ret)
> - goto pdown;
> + return ret;
>
> ret = ads1119_configure_channel(st, mux, gain, datarate);
> if (ret)
>
> ---
> base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f
> change-id: 20260228-ads1119-66b5271ef827
>
> Best regards,
next prev parent reply other threads:[~2026-02-28 11:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 17:48 [PATCH] iio: adc: ti-ads1119: Fix unbalanced pm reference count in ds1119_single_conversion() Felix Gu
2026-02-28 11:25 ` Jonathan Cameron [this message]
2026-02-28 19:22 ` João Paulo Gonçalves
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=20260228112559.03ec989c@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=francesco.dolcini@toradex.com \
--cc=francesco@dolcini.it \
--cc=joao.goncalves@toradex.com \
--cc=jpaulo.silvagoncalves@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=ustc.gu@gmail.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