Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Felix Gu and committed by
Jonathan Cameron
48a5c365 a0b9b0f1

+1 -1
+1 -1
drivers/iio/adc/ti-ads1119.c
··· 274 274 275 275 ret = pm_runtime_resume_and_get(dev); 276 276 if (ret) 277 - goto pdown; 277 + return ret; 278 278 279 279 ret = ads1119_configure_channel(st, mux, gain, datarate); 280 280 if (ret)