Skip to content

Commit e6f390a

Browse files
Navidemlinusw
authored andcommitted
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 <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent b3a9e3b commit e6f390a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpio/gpio-arizona.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
106106
ret = pm_runtime_get_sync(chip->parent);
107107
if (ret < 0) {
108108
dev_err(chip->parent, "Failed to resume: %d\n", ret);
109+
pm_runtime_put(chip->parent);
109110
return ret;
110111
}
111112
}

0 commit comments

Comments
 (0)