iio: pressure: zpa2326: handle pm_runtime_get_sync failure
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 5 Jun 2020 02:44:44 +0000 (21:44 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 14 Jun 2020 14:25:04 +0000 (15:25 +0100)
commitd88de040e1df38414fc1e4380be9d0e997ab4d58
treeab9ffd6f27bc73d4c42b144fc347fb5b5d99833b
parentd5ed76adb926a90fada98f518abc1ab6ef07d28f
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 <navid.emamdoost@gmail.com>
Fixes: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/zpa2326.c