diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2020-06-05 05:52:07 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-06-16 11:38:07 +0300 |
commit | e6f390a834b56583e6fc0949822644ce92fbb107 (patch) | |
tree | 72ea973763f2c5695a6fa6afae5329eca3e473f8 /drivers/gpio/gpio-arizona.c | |
parent | b3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff) | |
download | linux-e6f390a834b56583e6fc0949822644ce92fbb107.tar.xz |
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>
Diffstat (limited to 'drivers/gpio/gpio-arizona.c')
-rw-r--r-- | drivers/gpio/gpio-arizona.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c index 5640efe5e750..7520a13b4c7c 100644 --- a/drivers/gpio/gpio-arizona.c +++ b/drivers/gpio/gpio-arizona.c @@ -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; } } |