* [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure
@ 2025-12-14 14:58 Haotian Zhang
2025-12-15 9:23 ` Charles Keepax
2026-01-08 15:56 ` (subset) " Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Haotian Zhang @ 2025-12-14 14:58 UTC (permalink / raw)
To: lee; +Cc: ckeepax, patches, linux-kernel, Haotian Zhang
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>
---
drivers/mfd/arizona-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 85ff8717d850..91975536d14d 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -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:
--
2.50.1.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure
2025-12-14 14:58 [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure Haotian Zhang
@ 2025-12-15 9:23 ` Charles Keepax
2026-01-08 15:56 ` (subset) " Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2025-12-15 9:23 UTC (permalink / raw)
To: Haotian Zhang; +Cc: lee, ckeepax, patches, linux-kernel
On Sun, Dec 14, 2025 at 10:58:03PM +0800, Haotian Zhang wrote:
> 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>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (subset) [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure
2025-12-14 14:58 [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure Haotian Zhang
2025-12-15 9:23 ` Charles Keepax
@ 2026-01-08 15:56 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2026-01-08 15:56 UTC (permalink / raw)
To: lee, Haotian Zhang; +Cc: ckeepax, patches, linux-kernel
On Sun, 14 Dec 2025 22:58:03 +0800, Haotian Zhang wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure
commit: e8754afc3bd652c0d9f73511eb4604c50bc11b66
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-08 15:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-14 14:58 [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure Haotian Zhang
2025-12-15 9:23 ` Charles Keepax
2026-01-08 15:56 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox