iio: adc: ti-ads1119: Fix unbalanced pm reference count in ds1119_single_conversion()

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: a9306887eb ("iio: adc: ti-ads1119: Add driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Felix Gu
2026-02-28 01:48:19 +08:00
committed by Jonathan Cameron
parent a0b9b0f143
commit 48a5c36577

View File

@@ -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)