gpio: arizona: handle pm_runtime_get_sync failure case
[ Upstream commit e6f390a834
]
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>
This commit is contained in:
parent
4f80cb2c78
commit
52083907eb
|
@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
|
|||
ret = pm_runtime_get_sync(chip->parent);
|
||||
if (ret < 0) {
|
||||
dev_err(chip->parent, "Failed to resume: %d\n", ret);
|
||||
pm_runtime_put(chip->parent);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue