Skip to contentSkip to conversation

mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure

PATCH Applied Haotian Zhang 3 participants 3 messages Dec 14, 2025 – Jan 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/mfd/arizona-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/arizona-core.c +1 -1
index 85ff8717d850..91975536d14d 100644
@@ -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:
Signature · 1 line
2.50.1.windows.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · 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")

---

Thanks,
Charles

maintainer Applied
#2 lore raw

Re: (subset) [PATCH] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure

In reply to Haotian Zhang
Quoted 8 lines · 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.

[...]

Applied, thanks!

[1/1] mfd: arizona: Fix regulator resource leak on wm5102_clear_write_sequencer failure

      commit: e8754afc3bd652c0d9f73511eb4604c50bc11b66

--
Lee Jones [李琼斯]