[PATCH v4a 33/38] timers: s390/cmm: Use timer_shutdown_sync() before a module is released

From: Steven Rostedt
Date: Sat Nov 05 2022 - 02:02:03 EST


From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

Before a module is released, timer_shutdown_sync() must be called on its
timers.

Also call it in the failure path of the module init function.

Link: https://lore.kernel.org/all/20221104054053.431922658@xxxxxxxxxxx/

Cc: Heiko Carstens <hca@xxxxxxxxxxxxx>
Cc: Vasily Gorbik <gor@xxxxxxxxxxxxx>
Cc: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
Cc: Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>
Cc: Sven Schnelle <svens@xxxxxxxxxxxxx>
Cc: linux-s390@xxxxxxxxxxxxxxx
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
arch/s390/mm/cmm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 9141ed4c52e9..1a0a8aa43ac6 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -419,7 +419,7 @@ static int __init cmm_init(void)
#endif
unregister_sysctl_table(cmm_sysctl_header);
out_sysctl:
- del_timer_sync(&cmm_timer);
+ timer_shutdown_sync(&cmm_timer);
return rc;
}
module_init(cmm_init);
@@ -432,7 +432,7 @@ static void __exit cmm_exit(void)
#endif
unregister_oom_notifier(&cmm_oom_nb);
kthread_stop(cmm_thread_ptr);
- del_timer_sync(&cmm_timer);
+ timer_shutdown_sync(&cmm_timer);
cmm_free_pages(cmm_pages, &cmm_pages, &cmm_page_list);
cmm_free_pages(cmm_timed_pages, &cmm_timed_pages, &cmm_timed_page_list);
}
--
2.35.1