linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: aw9523: add missing mutex_destroy
@ 2024-10-01 21:27 Rosen Penev
  2024-10-01 21:27 ` [PATCH 2/2] pinctrl: aw9523: use enable for regulator Rosen Penev
  2024-10-02 13:49 ` [PATCH 1/2] pinctrl: aw9523: add missing mutex_destroy Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Rosen Penev @ 2024-10-01 21:27 UTC (permalink / raw)
  To: linux-gpio; +Cc: Linus Walleij, Liam Girdwood, Mark Brown, open list

Otherwise the mutex remains after a failed kzalloc.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/pinctrl/pinctrl-aw9523.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c
index b5e1c467625b..1374f30166bc 100644
--- a/drivers/pinctrl/pinctrl-aw9523.c
+++ b/drivers/pinctrl/pinctrl-aw9523.c
@@ -987,8 +987,10 @@ static int aw9523_probe(struct i2c_client *client)
 	lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter));
 
 	pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL);
-	if (!pdesc)
-		return -ENOMEM;
+	if (!pdesc) {
+		ret = -ENOMEM;
+		goto err_disable_vregs;
+	}
 
 	ret = aw9523_hw_init(awi);
 	if (ret)
-- 
2.46.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-02 13:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 21:27 [PATCH 1/2] pinctrl: aw9523: add missing mutex_destroy Rosen Penev
2024-10-01 21:27 ` [PATCH 2/2] pinctrl: aw9523: use enable for regulator Rosen Penev
2024-10-02 13:50   ` Linus Walleij
2024-10-02 13:49 ` [PATCH 1/2] pinctrl: aw9523: add missing mutex_destroy Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).