gpio: arizona: put pm_runtime in case of failure
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 5 Jun 2020 03:00:52 +0000 (22:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 05:42:51 +0000 (07:42 +0200)
commit9f86ae2ac86091d0b7cb4faba3782f997940b96c
tree87061a4d3fca19f3e00d979f08ab77e95335b93a
parente9103bb424ad007a973439e96454eb405db528a4
gpio: arizona: put pm_runtime in case of failure

[ Upstream commit 861254d826499944cb4d9b5a15f5a794a6b99a69 ]

Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200605030052.78235-1-navid.emamdoost@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-arizona.c