diff mbox series

[1/2] pinctrl: aw9523: add missing mutex_destroy

Message ID 20241001212724.309320-1-rosenp@gmail.com
State New
Headers show
Series [1/2] pinctrl: aw9523: add missing mutex_destroy | expand

Commit Message

Rosen Penev Oct. 1, 2024, 9:27 p.m. UTC
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(-)

Comments

Linus Walleij Oct. 2, 2024, 1:49 p.m. UTC | #1
On Tue, Oct 1, 2024 at 11:27 PM Rosen Penev <rosenp@gmail.com> wrote:

> Otherwise the mutex remains after a failed kzalloc.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Patch applied for fixes!

Yours,
Linus Walleij
diff mbox series

Patch

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)