Skip to contentSkip to conversation

gpio: arizona: handle pm_runtime_get_sync failure case

PATCH Superseded Navid Emamdoost 3 participants 3 messages Jun 5, 2020 – Jun 10, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/gpio/gpio-arizona.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-arizona.c +1 -0
index 5640efe5e750..7520a13b4c7c 100644
@@ -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