]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: ti-ads1119: Fix unbalanced pm reference count in ds1119_single_conversion()
authorFelix Gu <ustc.gu@gmail.com>
Fri, 27 Feb 2026 17:48:19 +0000 (01:48 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 1 Mar 2026 11:19:56 +0000 (11:19 +0000)
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>
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>
drivers/iio/adc/ti-ads1119.c

index c9cedc59cdcdb1cdc0563455d6b5c75270960dc8..4454f28b2b58e349de8e488a2c66e5b93a357d29 100644 (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)