All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix: mfd: of_syscon_register: fix reset_control reference leak on success   path
@ 2026-06-26 15:11 WenTao Liang
  2026-06-28  4:03 ` WenTao Liang
  2026-08-07 20:35 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: WenTao Liang @ 2026-06-26 15:11 UTC (permalink / raw)
  To: Lee Jones, linux-kernel; +Cc: stable, WenTao Liang

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@vger.kernel.org
Fixes: 7d1e3bd94828 ("mfd: syscon: Allow reset control for syscon devices")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
 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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-07 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 15:11 [PATCH] fix: mfd: of_syscon_register: fix reset_control reference leak on success path WenTao Liang
2026-06-28  4:03 ` WenTao Liang
2026-08-07 20:35 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.