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

From: Steven Rostedt
Date: Thu Oct 27 2022 - 11:09:56 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: Karsten Keil <isdn@xxxxxxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +-
drivers/isdn/mISDN/l1oip_core.c | 4 ++--
drivers/isdn/mISDN/timerdev.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 4f7eaa17fb27..8a212c17a093 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -4544,7 +4544,7 @@ release_port(struct hfc_multi *hc, struct dchannel *dch)
spin_lock_irqsave(&hc->lock, flags);

if (dch->timer.function) {
- del_timer(&dch->timer);
+ del_timer_shutdown(&dch->timer);
dch->timer.function = NULL;
}

diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index a77195e378b7..2d4b19e7d48b 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -1236,8 +1236,8 @@ release_card(struct l1oip *hc)

hc->shutdown = true;

- del_timer_sync(&hc->keep_tl);
- del_timer_sync(&hc->timeout_tl);
+ del_timer_shutdown(&hc->keep_tl);
+ del_timer_shutdown(&hc->timeout_tl);

cancel_work_sync(&hc->workq);

diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index abdf36ac3bee..9d69efb8a1bc 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -74,7 +74,7 @@ mISDN_close(struct inode *ino, struct file *filep)
while (!list_empty(list)) {
timer = list_first_entry(list, struct mISDNtimer, list);
spin_unlock_irq(&dev->lock);
- del_timer_sync(&timer->tl);
+ del_timer_shutdown(&timer->tl);
spin_lock_irq(&dev->lock);
/* it might have been moved to ->expired */
list_del(&timer->list);
@@ -204,7 +204,7 @@ misdn_del_timer(struct mISDNtimerdev *dev, int id)
list_del_init(&timer->list);
timer->id = -1;
spin_unlock_irq(&dev->lock);
- del_timer_sync(&timer->tl);
+ del_timer_shutdown(&timer->tl);
kfree(timer);
return id;
}
--
2.35.1