[PATCH] fix: mfd: of_syscon_register: fix reset_control reference leak on success path

From: WenTao Liang

Date: Fri Jun 26 2026 - 11:17:40 EST


of_reset_control_get_optional_exclusive acquires a reset control
reference. On the success path, the function stores regmap and np but
does not store or release the reset handle. Only error paths call
reset_control_put to release it. This leaks the reset control reference
on the success path.

Store the reset handle in syscon->reset so it can be properly managed.

Cc: stable@xxxxxxxxxxxxxxx
Fixes: 7d1e3bd94828 ("mfd: syscon: Allow reset control for syscon devices")
Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
---
drivers/mfd/syscon.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 21a7fcdd2737..28576a3c02fd 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -148,6 +148,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)

syscon->regmap = regmap;
syscon->np = np;
+ syscon->reset = reset;

list_add_tail(&syscon->list, &syscon_list);

--
2.39.5 (Apple Git-154)