summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorGuangshuo Li <lgs201920130244@gmail.com>2026-07-05 01:54:51 +0800
committerDaniel Lezcano <daniel.lezcano@kernel.org>2026-08-13 18:13:15 +0200
commite998c6300ef4e062a704ee17b5a812c0b595cf42 (patch)
treed5209d052a22aca137489cccc5ba03ae358c2c0c /drivers/clocksource
parent05520e035f8332c8e33f3011b5ca016fde61793d (diff)
clocksource/drivers/clps711x: Do not unmap clocksource MMIO
clps711x_clksrc_init() stores the timer base address in the static tcd pointer and registers it as both the clocksource MMIO address and the sched_clock read address. The clocksource init path must therefore keep the mapping alive after clps711x_timer_init() returns. However, the shared unmap_io exit path is also reached after successful clocksource registration, so the MMIO mapping is torn down while the clocksource and sched_clock readers may still access it. Return directly after successful clocksource registration and leave the mapping alive for the registered readers. Keep the unmap_io path for the error paths and for the clockevent init path. Fixes: cd32e596f02f ("clocksource/drivers/clps711x: Fix resource leaks in error paths") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260704175451.256364-1-lgs201920130244@gmail.com
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/clps711x-timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clocksource/clps711x-timer.c b/drivers/clocksource/clps711x-timer.c
index bb0a44adaf28..63ae3a691b14 100644
--- a/drivers/clocksource/clps711x-timer.c
+++ b/drivers/clocksource/clps711x-timer.c
@@ -94,7 +94,7 @@ static int __init clps711x_timer_init(struct device_node *np)
switch (of_alias_get_id(np, "timer")) {
case CLPS711X_CLKSRC_CLOCKSOURCE:
clps711x_clksrc_init(clock, base);
- break;
+ return 0;
case CLPS711X_CLKSRC_CLOCKEVENT:
ret = _clps711x_clkevt_init(clock, base, irq);
break;