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 08:19:34 +0000 (10:19 +0200)
commitbcf30d452ff700b58261e5cdf2bf411311c2d9eb
treedb5849a65d27e10b2b24f3343c13dc7d3bc60446
parenta523fb26dafefb64fd904fef834dfb6c8a805e3c
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