DORMANTno replies

[PATCH] clocksource/drivers/armv7m_systick: Fix clock reference leak

From: Wentao Liang <hidden>
Date: 2026-09-15 05:51:23
Also in: lkml, stable
Subsystem: arm/stm32 architecture, clocksource, clockevent drivers, the rest · Maintainers: Maxime Coquelin, Alexandre Torgue, Daniel Lezcano, Thomas Gleixner, Linus Torvalds

system_timer_of_register() obtains the timer clock with of_clk_get()
and enables it, but on the success path the local clock reference is
simply dropped without clk_put(), leaking the consumer reference. The
error labels already release the clock.

Release the reference with clk_put() before returning success. The
clock remains prepared and enabled, so the timer keeps running.

Fixes: 4958ebb3d027 ("clocksource/drivers/armv7m_systick: Add ARM System timer driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <redacted>
---
 drivers/clocksource/armv7m_systick.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/clocksource/armv7m_systick.c b/drivers/clocksource/armv7m_systick.c
index 7e78074480e4..1810f811bb2a 100644
--- a/drivers/clocksource/armv7m_systick.c
+++ b/drivers/clocksource/armv7m_systick.c
@@ -69,6 +69,9 @@ static int __init system_timer_of_register(struct device_node *np)
 
 	pr_info("ARM System timer initialized as clocksource\n");
 
+	if (clk)
+		clk_put(clk);
+
 	return 0;
 
 out_clk_disable:
-- 
2.34.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help