Skip to content

Commit 4feb753

Browse files
ISCAS-Vulablag-linaro
authored andcommitted
mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer() failure
The wm5102_clear_write_sequencer() helper may return an error and just return, bypassing the cleanup sequence and causing regulators to remain enabled, leading to a resource leak. Change the direct return to jump to the err_reset label to properly free the resources. Fixes: 1c1c6bb ("mfd: wm5102: Ensure we always boot the device fully") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20251214145804.2037-1-vulab@iscas.ac.cn Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 20117c9 commit 4feb753

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mfd/arizona-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ int arizona_dev_init(struct arizona *arizona)
11001100
} else if (val & 0x01) {
11011101
ret = wm5102_clear_write_sequencer(arizona);
11021102
if (ret)
1103-
return ret;
1103+
goto err_reset;
11041104
}
11051105
break;
11061106
default:

0 commit comments

Comments
 (0)