Steven Rostedt (Google)
292a089d78
treewide: Convert del_timer*() to timer_shutdown*()
...
Due to several bugs caused by timers being re-armed after they are
shutdown and just before they are freed, a new state of timers was added
called "shutdown". After a timer is set to this state, then it can no
longer be re-armed.
The following script was run to find all the trivial locations where
del_timer() or del_timer_sync() is called in the same function that the
object holding the timer is freed. It also ignores any locations where
the timer->function is modified between the del_timer*() and the free(),
as that is not considered a "trivial" case.
This was created by using a coccinelle script and the following
commands:
$ cat timer.cocci
@@
expression ptr, slab;
identifier timer, rfield;
@@
(
- del_timer(&ptr->timer);
+ timer_shutdown(&ptr->timer);
|
- del_timer_sync(&ptr->timer);
+ timer_shutdown_sync(&ptr->timer);
)
... when strict
when != ptr->timer
(
kfree_rcu(ptr, rfield);
|
kmem_cache_free(slab, ptr);
|
kfree(ptr);
)
$ spatch timer.cocci . > /tmp/t.patch
$ patch -p1 < /tmp/t.patch
Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ]
Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ]
Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-12-25 13:38:09 -08:00
..
2022-12-20 09:45:53 +01:00
2022-12-13 13:32:56 -08:00
2022-11-14 17:24:44 +01:00
2022-06-13 17:25:08 +02:00
2022-10-20 12:11:56 +02:00
2022-06-15 15:51:46 +02:00
2021-05-05 14:29:13 +02:00
2019-05-30 11:26:32 -07:00
2022-11-21 22:17:10 +01:00
2022-11-14 23:46:20 +01:00
2020-03-13 17:33:11 +01:00
2022-11-02 14:11:06 +01:00
2019-05-21 10:50:45 +02:00
2019-10-03 15:36:40 -04:00
2019-05-30 11:26:32 -07:00
2021-09-15 16:31:21 +02:00
2022-05-06 10:46:36 +02:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2021-07-28 11:51:07 +02:00
2022-11-21 22:09:01 +01:00
2021-12-02 15:36:18 +01:00
2021-10-07 13:37:25 +02:00
2022-06-09 10:55:46 +02:00
2019-09-03 16:52:04 +02:00
2020-10-23 13:23:44 +02:00
2022-11-22 17:50:36 -08:00
2019-10-03 15:36:40 -04:00
2022-11-21 22:17:10 +01:00
2020-11-25 17:40:23 +01:00
2022-02-17 14:14:41 +01:00
2019-10-03 15:36:40 -04:00
2019-05-30 11:26:32 -07:00
2022-11-11 11:09:36 +01:00
2019-10-03 15:36:40 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-08-22 17:11:58 +02:00
2020-03-18 13:36:21 +01:00
2022-08-25 11:37:21 +02:00
2021-05-27 15:40:34 +02:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2021-12-20 11:25:42 +01:00
2019-10-03 15:36:40 -04:00
2022-12-13 14:32:07 +01:00
2019-05-30 11:26:32 -07:00
2022-12-20 15:35:21 +01:00
2022-12-20 15:33:37 +01:00
2022-11-14 23:55:12 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2022-05-11 14:19:27 +02:00
2019-05-30 11:26:32 -07:00
2022-04-21 10:28:49 +02:00
2022-10-18 14:43:59 +02:00
2022-01-06 14:22:51 +01:00
2019-10-03 15:36:40 -04:00
2019-10-03 15:36:40 -04:00
2022-11-14 23:56:52 +01:00
2017-11-02 11:10:55 +01:00
2022-07-21 13:47:12 +02:00
2021-12-02 15:36:18 +01:00
2017-11-02 11:10:55 +01:00
2019-10-03 15:36:40 -04:00
2022-02-16 16:26:21 +01:00
2022-12-19 12:06:44 +01:00
2020-08-17 11:38:49 +02:00
2022-10-14 10:47:50 +01:00
2019-01-14 20:11:01 +01:00
2022-12-19 13:12:24 +01:00
2022-05-06 08:29:26 +02:00
2020-11-25 14:30:33 +01:00
2020-09-02 12:55:46 -07:00
2019-05-30 11:26:32 -07:00
2022-12-20 15:34:16 +01:00
2022-09-21 13:25:26 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:30:28 +02:00
2020-09-03 16:18:55 +02:00
2021-04-07 18:46:20 +02:00
2019-06-05 17:30:28 +02:00
2022-05-03 16:04:22 +02:00
2019-06-05 17:30:28 +02:00
2019-06-05 17:30:28 +02:00
2019-06-05 17:30:28 +02:00
2019-05-30 11:26:35 -07:00
2022-12-20 15:35:21 +01:00
2022-12-19 13:18:02 +01:00
2019-06-05 17:36:37 +02:00
2021-12-02 15:36:18 +01:00
2022-09-20 11:36:21 +01:00
2022-11-22 10:25:30 +01:00
2022-02-16 17:12:14 +01:00
2018-06-25 15:23:40 +02:00
2019-05-30 11:26:32 -07:00
2022-11-21 18:56:20 +01:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2021-09-25 08:20:48 -07:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2021-12-02 15:36:18 +01:00
2021-12-02 15:36:18 +01:00
2019-05-30 11:26:32 -07:00
2022-09-20 14:49:15 +02:00
2022-10-18 14:42:45 +02:00
2021-12-02 15:36:18 +01:00
2021-05-05 14:21:08 +02:00
2022-11-21 22:13:40 +01:00
2021-05-05 14:36:18 +02:00
2022-02-02 15:12:22 +01:00
2019-05-30 11:26:35 -07:00
2022-12-20 15:37:52 +01:00
2019-05-30 11:26:32 -07:00
2022-10-05 10:19:06 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2022-08-25 11:38:55 +02:00
2019-05-30 11:26:32 -07:00
2021-12-14 10:50:23 +01:00
2022-09-20 12:16:25 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:19 -07:00
2022-11-25 17:39:19 +08:00
2022-11-21 18:35:01 +01:00
2022-11-14 15:03:48 +01:00
2022-11-04 15:53:25 +01:00
2022-08-25 10:26:31 +02:00
2022-11-14 15:03:48 +01:00
2022-12-13 14:42:10 +01:00
2022-11-04 15:53:25 +01:00
2020-07-20 12:24:41 +02:00
2022-05-11 14:19:27 +02:00
2022-08-25 11:37:21 +02:00
2022-08-25 11:37:21 +02:00
2022-08-25 11:37:21 +02:00
2022-09-20 11:35:00 +01:00
2019-05-30 11:26:32 -07:00
2022-12-25 13:38:09 -08:00
2019-05-30 11:26:32 -07:00
2022-11-04 09:57:16 +01:00
2022-11-04 09:57:16 +01:00
2021-09-22 11:53:07 +02:00
2019-05-30 11:26:32 -07:00
2019-10-03 15:36:40 -04:00
2019-05-30 11:26:32 -07:00
2022-08-25 11:30:50 +02:00
2022-12-19 13:18:02 +01:00
2022-10-05 10:34:48 +01:00
2022-02-25 09:36:06 +01:00
2022-12-20 15:29:10 +01:00
2022-12-20 15:29:10 +01:00
2022-12-20 15:29:10 +01:00
2022-08-25 11:32:31 +02:00