Skip to contentSkip to conversation

pinctrl: aw9523: fix mutex unlock in error path

PATCH In review Bartosz Golaszewski 2 participants 2 messages Jun 19, 2025 – Jun 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: aw9523: fix mutex unlock in error path

From: Bartosz Golaszewski <[email protected]>

We must unlock the mutex *after* the out label or we'd trigger a deadlock in error path.

Fixes dffe286e2428 ("pinctrl: aw9523: use new GPIO line value setter callbacks")
---
 drivers/pinctrl/pinctrl-aw9523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-aw9523.c +1 -1
index c84454038419..2935b2cceb03 100644
@@ -652,9 +652,9 @@ static int aw9523_gpio_set_multiple(struct gpio_chip *chip,
 		if (ret)
 			goto out;
 	}
-	mutex_unlock(&awi->i2c_lock);
 
 out:
+	mutex_unlock(&awi->i2c_lock);
 	return ret;
 }
 
Signature · 1 line
2.48.1
#1 lore raw
Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We must unlock the mutex *after* the out label or we'd trigger a deadlock in error path.

Fixes dffe286e2428 ("pinctrl: aw9523: use new GPIO line value setter callbacks")

Patch applied!

Yours,
Linus Walleij