* [PATCH] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure
@ 2026-09-15 4:52 Wentao Liang
2026-09-15 17:13 ` Baruch Siach
2026-10-14 20:20 ` [clocksource: timers/drivers/next] " clocksource-bot for Wentao Liang
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2026-09-15 4:52 UTC (permalink / raw)
To: baruch
Cc: daniel.lezcano, linux-arm-kernel, linux-kernel, tglx, lkml,
Wentao Liang, stable
digicolor_timer_init() obtains the timer clock with of_clk_get() and
enables it, but the request_irq() failure path returns without releasing
the clock reference, leaking both the enable/prepare state and the
reference itself.
Disable and put the clock before returning on the request_irq() failure
path. The success path keeps the clock enabled for the lifetime of the
timer and is left untouched.
Fixes: 9b8bb7736b78 ("clocksource: Driver for Conexant Digicolor SoC timer")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/clocksource/timer-digicolor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clocksource/timer-digicolor.c b/drivers/clocksource/timer-digicolor.c
index 559aa96089c3..46e0c329957a 100644
--- a/drivers/clocksource/timer-digicolor.c
+++ b/drivers/clocksource/timer-digicolor.c
@@ -190,6 +190,8 @@ static int __init digicolor_timer_init(struct device_node *node)
&dc_timer_dev.ce);
if (ret) {
pr_warn("request of timer irq %d failed (%d)\n", irq, ret);
+ clk_disable_unprepare(clk);
+ clk_put(clk);
return ret;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure
2026-09-15 4:52 [PATCH] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure Wentao Liang
@ 2026-09-15 17:13 ` Baruch Siach
2026-10-14 20:20 ` [clocksource: timers/drivers/next] " clocksource-bot for Wentao Liang
1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2026-09-15 17:13 UTC (permalink / raw)
To: Wentao Liang
Cc: daniel.lezcano, linux-arm-kernel, linux-kernel, tglx, lkml,
stable
Hi Wentao Liang,
On Tue, Sep 15 2026, Wentao Liang wrote:
> digicolor_timer_init() obtains the timer clock with of_clk_get() and
> enables it, but the request_irq() failure path returns without releasing
> the clock reference, leaking both the enable/prepare state and the
> reference itself.
>
> Disable and put the clock before returning on the request_irq() failure
> path. The success path keeps the clock enabled for the lifetime of the
> timer and is left untouched.
>
> Fixes: 9b8bb7736b78 ("clocksource: Driver for Conexant Digicolor SoC timer")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Thanks,
baruch
> ---
> drivers/clocksource/timer-digicolor.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/clocksource/timer-digicolor.c b/drivers/clocksource/timer-digicolor.c
> index 559aa96089c3..46e0c329957a 100644
> --- a/drivers/clocksource/timer-digicolor.c
> +++ b/drivers/clocksource/timer-digicolor.c
> @@ -190,6 +190,8 @@ static int __init digicolor_timer_init(struct device_node *node)
> &dc_timer_dev.ce);
> if (ret) {
> pr_warn("request of timer irq %d failed (%d)\n", irq, ret);
> + clk_disable_unprepare(clk);
> + clk_put(clk);
> return ret;
> }
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 3+ messages in thread
* [clocksource: timers/drivers/next] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure
2026-09-15 4:52 [PATCH] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure Wentao Liang
2026-09-15 17:13 ` Baruch Siach
@ 2026-10-14 20:20 ` clocksource-bot for Wentao Liang
1 sibling, 0 replies; 3+ messages in thread
From: clocksource-bot for Wentao Liang @ 2026-10-14 20:20 UTC (permalink / raw)
To: linux-kernel
Cc: stable, Wentao Liang, Daniel Lezcano, Baruch Siach,
daniel.lezcano
The following commit has been merged into the timers/drivers/next branch of clocksource:
Commit-ID: 9cc2e18b32f12d26ae6729c62a03640423956b17
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux.git//9cc2e18b32f12d26ae6729c62a03640423956b17
Author: Wentao Liang <vulab@iscas.ac.cn>
AuthorDate: Tue, 15 Sep 2026 04:52:42
Committer: Daniel Lezcano <daniel.lezcano@kernel.org>
CommitterDate: Wed, 07 Oct 2026 15:46:01 +02:00
clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure
digicolor_timer_init() obtains the timer clock with of_clk_get() and
enables it, but the request_irq() failure path returns without releasing
the clock reference, leaking both the enable/prepare state and the
reference itself.
Disable and put the clock before returning on the request_irq() failure
path. The success path keeps the clock enabled for the lifetime of the
timer and is left untouched.
Fixes: 9b8bb7736b78 ("clocksource: Driver for Conexant Digicolor SoC timer")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Link: https://patch.msgid.link/20260915045242.1726702-1-vulab@iscas.ac.cn
---
drivers/clocksource/timer-digicolor.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clocksource/timer-digicolor.c b/drivers/clocksource/timer-digicolor.c
index 559aa96..46e0c32 100644
--- a/drivers/clocksource/timer-digicolor.c
+++ b/drivers/clocksource/timer-digicolor.c
@@ -190,6 +190,8 @@ static int __init digicolor_timer_init(struct device_node *node)
&dc_timer_dev.ce);
if (ret) {
pr_warn("request of timer irq %d failed (%d)\n", irq, ret);
+ clk_disable_unprepare(clk);
+ clk_put(clk);
return ret;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-14 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 4:52 [PATCH] clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure Wentao Liang
2026-09-15 17:13 ` Baruch Siach
2026-10-14 20:20 ` [clocksource: timers/drivers/next] " clocksource-bot for Wentao Liang
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.