[PATCH 1/6] clocksource/drivers/bcm_kona: Fix clock reference leak in kona_timer_init

From: Wentao Liang

Date: Tue Sep 15 2026 - 01:16:12 EST


kona_timer_init() looks up the timer clock with of_clk_get_by_name(),
which takes a reference on the clock. On success the driver only reads
the rate and prepares/enables the clock, and the clock is meant to stay
enabled for the lifetime of the timer, but the pointer is a local
variable that is lost when the function returns and clk_put() is never
called, leaking the consumer reference on every boot.

Drop the reference with clk_put() right after the clock has been
prepared and enabled; this keeps the clock running while releasing the
reference.

Fixes: ad037c1f4ae6 ("clocksource: Kona: Print warning rather than panic")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/clocksource/bcm_kona_timer.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
index 39f172d7e29e..9768b62725ba 100644
--- a/drivers/clocksource/bcm_kona_timer.c
+++ b/drivers/clocksource/bcm_kona_timer.c
@@ -160,6 +160,7 @@ static int __init kona_timer_init(struct device_node *node)
if (!IS_ERR(external_clk)) {
arch_timer_rate = clk_get_rate(external_clk);
clk_prepare_enable(external_clk);
+ clk_put(external_clk);
} else if (!of_property_read_u32(node, "clock-frequency", &freq)) {
arch_timer_rate = freq;
} else {
--
2.34.1