* [PATCH] clocksource/drivers/stm: Fix double deregistration on probe failure
@ 2025-10-17 5:50 Johan Hovold
2025-11-05 13:43 ` Daniel Lezcano
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2025-10-17 5:50 UTC (permalink / raw)
To: Daniel Lezcano, Thomas Gleixner
Cc: Maxime Coquelin, Alexandre Torgue, linux-kernel, Johan Hovold
The purpose of the devm_add_action_or_reset() helper is to call the
action function in case adding an action ever fails so drop the clock
source deregistration from the error path to avoid deregistering twice.
Fixes: cec32ac75827 ("clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms")
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/clocksource/timer-nxp-stm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clocksource/timer-nxp-stm.c b/drivers/clocksource/timer-nxp-stm.c
index ce10bdcfc76b..c320d764b12e 100644
--- a/drivers/clocksource/timer-nxp-stm.c
+++ b/drivers/clocksource/timer-nxp-stm.c
@@ -208,10 +208,8 @@ static int nxp_stm_clocksource_init(struct device *dev, struct stm_timer *stm_ti
return ret;
ret = devm_add_action_or_reset(dev, devm_clocksource_unregister, stm_timer);
- if (ret) {
- clocksource_unregister(&stm_timer->cs);
+ if (ret)
return ret;
- }
stm_sched_clock = stm_timer;
--
2.49.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clocksource/drivers/stm: Fix double deregistration on probe failure
2025-10-17 5:50 [PATCH] clocksource/drivers/stm: Fix double deregistration on probe failure Johan Hovold
@ 2025-11-05 13:43 ` Daniel Lezcano
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2025-11-05 13:43 UTC (permalink / raw)
To: Johan Hovold, Thomas Gleixner
Cc: Maxime Coquelin, Alexandre Torgue, linux-kernel
On 10/17/25 07:50, Johan Hovold wrote:
> The purpose of the devm_add_action_or_reset() helper is to call the
> action function in case adding an action ever fails so drop the clock
> source deregistration from the error path to avoid deregistering twice.
>
> Fixes: cec32ac75827 ("clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms")
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Ah, right. Good catch, thanks for fixing this
I picked it up
-- Daniel
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: timers/clocksource] clocksource/drivers/stm: Fix double deregistration on probe failure
2025-10-17 5:50 [PATCH] clocksource/drivers/stm: Fix double deregistration on probe failure Johan Hovold
2025-11-05 13:43 ` Daniel Lezcano
@ 2025-11-26 14:40 ` tip-bot2 for Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Johan Hovold @ 2025-11-26 14:40 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Johan Hovold, Daniel Lezcano, x86, linux-kernel
The following commit has been merged into the timers/clocksource branch of tip:
Commit-ID: 6b38a8b31e2c5c2c3fd5f9848850788c190f216d
Gitweb: https://git.kernel.org/tip/6b38a8b31e2c5c2c3fd5f9848850788c190f216d
Author: Johan Hovold <johan@kernel.org>
AuthorDate: Fri, 17 Oct 2025 07:50:39 +02:00
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Wed, 26 Nov 2025 11:24:37 +01:00
clocksource/drivers/stm: Fix double deregistration on probe failure
The purpose of the devm_add_action_or_reset() helper is to call the
action function in case adding an action ever fails so drop the clock
source deregistration from the error path to avoid deregistering twice.
Fixes: cec32ac75827 ("clocksource/drivers/nxp-timer: Add the System Timer Module for the s32gx platforms")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/20251017055039.7307-1-johan@kernel.org
---
drivers/clocksource/timer-nxp-stm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clocksource/timer-nxp-stm.c b/drivers/clocksource/timer-nxp-stm.c
index bbc4062..16d5216 100644
--- a/drivers/clocksource/timer-nxp-stm.c
+++ b/drivers/clocksource/timer-nxp-stm.c
@@ -208,10 +208,8 @@ static int __init nxp_stm_clocksource_init(struct device *dev, struct stm_timer
return ret;
ret = devm_add_action_or_reset(dev, devm_clocksource_unregister, stm_timer);
- if (ret) {
- clocksource_unregister(&stm_timer->cs);
+ if (ret)
return ret;
- }
stm_sched_clock = stm_timer;
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-26 14:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 5:50 [PATCH] clocksource/drivers/stm: Fix double deregistration on probe failure Johan Hovold
2025-11-05 13:43 ` Daniel Lezcano
2025-11-26 14:40 ` [tip: timers/clocksource] " tip-bot2 for Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox