gpio: arizona: handle pm_runtime_get_sync failure case
Subsystems (2)
PATCH 1/1 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]>
--- drivers/gpio/gpio-arizona.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-arizona.c +1 -0
@@ -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; } }
Signature · 1 line
2.17.1
Quoted 6 lines · Navid Emamdoost
Calling
pm_runtime_get_syncincrements the counter even in case of failure, causing incorrect ref count. Callpm_runtime_putifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>---
Acked-by Charles Keepax <[email protected]>
Thanks,
Charles
Quoted 5 lines · Navid Emamdoost
Calling
pm_runtime_get_syncincrements the counter even in case of failure, causing incorrect ref count. Callpm_runtime_putifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>
Patch applied for fixes.
Yours,
Linus Walleij