Commit e6f390a8 authored by Navid Emamdoost's avatar Navid Emamdoost Committed by Linus Walleij

gpio: arizona: handle pm_runtime_get_sync failure case

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: default avatarNavid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200605025207.65719-1-navid.emamdoost@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b3a9e3b9
......@@ -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;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment