Skip to content

Commit d88de04

Browse files
Navidemjic23
authored andcommitted
iio: pressure: zpa2326: handle pm_runtime_get_sync failure
Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails. Signed-off-by: Navid Emamdoost <[email protected]> Fixes: 03b262f ("iio:pressure: initial zpa2326 barometer support") Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent d5ed76a commit d88de04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/iio/pressure/zpa2326.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev)
665665
int err;
666666

667667
err = pm_runtime_get_sync(indio_dev->dev.parent);
668-
if (err < 0)
668+
if (err < 0) {
669+
pm_runtime_put(indio_dev->dev.parent);
669670
return err;
671+
}
670672

671673
if (err > 0) {
672674
/*

0 commit comments

Comments
 (0)