]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer() failure
authorHaotian Zhang <vulab@iscas.ac.cn>
Sun, 14 Dec 2025 14:58:03 +0000 (22:58 +0800)
committerLee Jones <lee@kernel.org>
Thu, 22 Jan 2026 14:22:26 +0000 (14:22 +0000)
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>
drivers/mfd/arizona-core.c

index 85ff8717d85047348622fb78751d9abde66c61d0..91975536d14d21729e3f50efe5594000c7477d28 100644 (file)
@@ -1100,7 +1100,7 @@ int arizona_dev_init(struct arizona *arizona)
                } else if (val & 0x01) {
                        ret = wm5102_clear_write_sequencer(arizona);
                        if (ret)
-                               return ret;
+                               goto err_reset;
                }
                break;
        default: