Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74953eff authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Greg Kroah-Hartman
Browse files

iio: pressure: zpa2326: handle pm_runtime_get_sync failure



commit d88de040e1df38414fc1e4380be9d0e997ab4d58 upstream.

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: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Fixes: 03b262f2 ("iio:pressure: initial zpa2326 barometer support")
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4ecff6ee
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -664,8 +664,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev)
	int err;

	err = pm_runtime_get_sync(indio_dev->dev.parent);
	if (err < 0)
	if (err < 0) {
		pm_runtime_put(indio_dev->dev.parent);
		return err;
	}

	if (err > 0) {
		/*