Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: aw9523: add missing mutex_destroy

Otherwise the mutex remains after a failed kzalloc.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://lore.kernel.org/20241001212724.309320-1-rosenp@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Rosen Penev and committed by
Linus Walleij
be86c553 58414a31

+4 -2
+4 -2
drivers/pinctrl/pinctrl-aw9523.c
··· 980 980 lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter)); 981 981 982 982 pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL); 983 - if (!pdesc) 984 - return -ENOMEM; 983 + if (!pdesc) { 984 + ret = -ENOMEM; 985 + goto err_disable_vregs; 986 + } 985 987 986 988 ret = aw9523_hw_init(awi); 987 989 if (ret)