mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 03:33:07 +07:00
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: 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>
This commit is contained in:
parent
b3a9e3b962
commit
e6f390a834
@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
|
|||||||
ret = pm_runtime_get_sync(chip->parent);
|
ret = pm_runtime_get_sync(chip->parent);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(chip->parent, "Failed to resume: %d\n", ret);
|
dev_err(chip->parent, "Failed to resume: %d\n", ret);
|
||||||
|
pm_runtime_put(chip->parent);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user