Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Johan Hovold and committed by
Daniel Lezcano
6b38a8b3 2ba8e2aa

+1 -3
+1 -3
drivers/clocksource/timer-nxp-stm.c
··· 208 208 return ret; 209 209 210 210 ret = devm_add_action_or_reset(dev, devm_clocksource_unregister, stm_timer); 211 - if (ret) { 212 - clocksource_unregister(&stm_timer->cs); 211 + if (ret) 213 212 return ret; 214 - } 215 213 216 214 stm_sched_clock = stm_timer; 217 215