mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
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
69b94dd6dc
commit
e9103bb424
1 changed files with 1 additions and 0 deletions
|
@ -111,6 +111,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 a new issue