[RFC][PATCH v2 22/31] timers: workqueue: Use del_timer_shutdown() before freeing timer

From: Steven Rostedt
Date: Thu Oct 27 2022 - 11:10:51 EST


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

Before a timer is freed, del_timer_shutdown() must be called.

Link: https://lore.kernel.org/all/20220407161745.7d6754b3@xxxxxxxxxxxxxxxxxx/

Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Lai Jiangshan <jiangshanlai@xxxxxxxxx>
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
kernel/workqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7cd5f5e7e0a1..47a7124bbea4 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3608,8 +3608,8 @@ static void put_unbound_pool(struct worker_pool *pool)
wait_for_completion(pool->detach_completion);

/* shut down the timers */
- del_timer_sync(&pool->idle_timer);
- del_timer_sync(&pool->mayday_timer);
+ del_timer_shutdown(&pool->idle_timer);
+ del_timer_shutdown(&pool->mayday_timer);

/* RCU protected to allow dereferences from get_work_pool() */
call_rcu(&pool->rcu, rcu_free_pool);
--
2.35.1