gpio: arizona: handle pm_runtime_get_sync failure case
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 5 Jun 2020 02:52:07 +0000 (21:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:34 +0000 (10:19 +0200)
commita523fb26dafefb64fd904fef834dfb6c8a805e3c
tree9d81c2f455e0e8f6c901536dfa163330ecb9523c
parentaa5d7aaa5aa95ebecb8ccbf6df914939e00aa712
gpio: arizona: handle pm_runtime_get_sync failure case

[ Upstream commit e6f390a834b56583e6fc0949822644ce92fbb107 ]

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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200605025207.65719-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