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

Configure Feed

Select the types of activity you want to include in your feed.

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: 1c1c6bba57f5 ("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>

authored by

Haotian Zhang and committed by
Lee Jones
4feb753b 20117c92

+1 -1
+1 -1
drivers/mfd/arizona-core.c
··· 1100 1100 } else if (val & 0x01) { 1101 1101 ret = wm5102_clear_write_sequencer(arizona); 1102 1102 if (ret) 1103 - return ret; 1103 + goto err_reset; 1104 1104 } 1105 1105 break; 1106 1106 default: