mirror_ubuntu-kernels/drivers/net/wireless/intel/iwlwifi
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
..
cfg wifi: iwlwifi: cfg: disable STBC for BL step A devices 2022-11-10 13:26:41 +02:00
dvm wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
fw wifi: iwlwifi: fw: use correct IML/ROM status register 2022-12-07 17:36:50 +02:00
mei wifi: iwlwifi: mei: clean up comments 2022-12-07 17:36:31 +02:00
mvm treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
pcie wifi: iwlwifi: pcie: Add reading and storing of crf and cdb id. 2022-12-07 17:36:20 +02:00
queue iwlwifi: use 4k queue size for Bz A-step 2022-03-10 09:23:28 +02:00
iwl-agn-hw.h
iwl-config.h wifi: iwlwifi: pcie: add support for BZ devices 2022-09-18 14:40:12 +03:00
iwl-context-info-gen3.h iwlwifi: mvm: add support for IMR based on platform 2022-03-10 09:23:27 +02:00
iwl-context-info.h
iwl-csr.h brcmfmac 2022-03-11 13:00:17 -08:00
iwl-dbg-tlv.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
iwl-dbg-tlv.h iwlwifi: Configure FW debug preset via module param. 2022-03-10 09:23:27 +02:00
iwl-debug.c
iwl-debug.h
iwl-devtrace-data.h
iwl-devtrace-io.h
iwl-devtrace-iwlwifi.h
iwl-devtrace-msg.h tracing/iwlwifi: Use the new __vstring() helper 2022-07-15 17:44:40 -04:00
iwl-devtrace-ucode.h
iwl-devtrace.c
iwl-devtrace.h
iwl-drv.c wifi: iwlwifi: mvm: Advertise EHT capabilities 2022-11-28 17:52:51 +02:00
iwl-drv.h iwlwifi: move symbols into a separate namespace 2022-02-18 10:40:52 +02:00
iwl-eeprom-parse.c iwlwifi: iwl-eeprom-parse: mostly dvm only 2021-12-21 12:35:04 +02:00
iwl-eeprom-parse.h wifi: iwlwifi: mvm: Advertise EHT capabilities 2022-11-28 17:52:51 +02:00
iwl-eeprom-read.c iwlwifi: eeprom: clean up macros 2022-02-18 10:40:53 +02:00
iwl-eeprom-read.h
iwl-fh.h iwlwifi: yoyo: add IMR DRAM dump support 2022-02-18 10:40:51 +02:00
iwl-io.c iwlwifi: make some functions friendly to sparse 2022-02-18 10:40:52 +02:00
iwl-io.h
iwl-modparams.h wifi: iwlwifi: mvm: Advertise EHT capabilities 2022-11-28 17:52:51 +02:00
iwl-nvm-parse.c wifi: iwlwifi: nvm-parse: enable WiFi7 for Fm radio for now 2022-12-07 17:35:06 +02:00
iwl-nvm-parse.h iwlwifi: integrate with iwlmei 2021-11-26 18:31:48 +02:00
iwl-op-mode.h
iwl-phy-db.c iwlwifi: remove unused macros 2022-02-18 10:40:53 +02:00
iwl-phy-db.h
iwl-prph.h wifi: iwlwifi: mvm: trigger PCI re-enumeration in case of PLDR sync 2022-11-28 17:53:58 +02:00
iwl-scd.h
iwl-trans.c iwlwifi: cfg: add support for 1K BA queue 2022-02-18 10:40:50 +02:00
iwl-trans.h wifi: iwlwifi: pcie: Add reading and storing of crf and cdb id. 2022-12-07 17:36:20 +02:00
Kconfig wifi: iwlwifi: Mark IWLMEI as broken 2022-09-12 14:22:55 +03:00
Makefile iwlwifi: mei: add the driver to allow cooperation with CSME 2021-11-26 18:31:47 +02:00