linux/drivers/input/mouse
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
..
alps.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
alps.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
amimouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
appletouch.c Input: appletouch - initialize work before device registration 2021-12-30 21:04:04 -08:00
atarimouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
bcm5974.c Input: bcm5974 - set missing URB_NO_TRANSFER_DMA_MAP urb flag 2022-06-07 13:44:39 -07:00
byd.c Input: byd - fix typo in a comment 2021-12-20 00:59:50 -08:00
byd.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
cyapa_gen3.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
cyapa_gen5.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
cyapa_gen6.c Input: cyapa_gen6 - aligned "*" each line 2022-06-22 16:14:37 -07:00
cyapa.c Input: cyapa - Convert to i2c's .probe_new() 2022-12-02 14:53:43 -08:00
cyapa.h Input: cyapa - fix for losing events during device power transitions 2016-03-04 11:32:13 -08:00
cypress_ps2.c Input: cypress_ps2 - fix typo in comment 2022-05-21 12:48:39 -07:00
cypress_ps2.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
elan_i2c_core.c Input: elan_i2c_core - Convert to i2c's .probe_new() 2022-12-02 14:53:43 -08:00
elan_i2c_i2c.c Input: elan_i2c - fix firmware update on newer ICs 2020-11-11 20:13:12 -08:00
elan_i2c_smbus.c Merge branch 'next' into for-linus 2020-12-14 16:27:23 -08:00
elan_i2c.h Input: elan_i2c - reduce the resume time for controller in Whitebox 2021-09-06 22:30:34 -07:00
elantech.c Input: elantech - fix stack out of bound access in elantech_change_report_id() 2021-11-29 00:11:15 -08:00
elantech.h Input: elantech - fix protocol errors for some trackpoints in SMBus mode 2020-12-11 00:15:05 -08:00
focaltech.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
focaltech.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
gpio_mouse.c Input: gpio_mouse - fix typos in comments 2022-06-22 15:29:35 -07:00
hgpk.c Input: hgpk - fix repeated word in a comment 2022-09-08 14:06:23 -07:00
hgpk.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
inport.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
Kconfig Input: vsxxxaa - fix Kconfig spelling mistake 2020-12-04 12:27:35 -08:00
lifebook.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lifebook.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
logibm.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
logips2pp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
logips2pp.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
maplemouse.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
navpoint.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
pc110pad.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
psmouse-base.c Input: psmouse - switch to using dev_groups for driver-specific attributes 2022-09-03 12:31:18 -07:00
psmouse-smbus.c Input: psmouse-smbus - avoid flush_scheduled_work() usage 2022-05-16 21:10:14 -07:00
psmouse.h Input: psmouse-smbus - allow to control psmouse_deactivate 2018-05-23 16:49:22 -07:00
pxa930_trkball.c ARM: pxa: split up mach/hardware.h 2022-04-19 16:27:05 +02:00
rpcmouse.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sentelic.c Input: sentelic - fix error return when fsp_reg_write fails 2020-08-06 17:33:43 -07:00
sentelic.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
sermouse.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
synaptics_i2c.c Input: synaptics_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:43 -08:00
synaptics_usb.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
synaptics.c Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode 2022-10-15 20:44:12 -07:00
synaptics.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
touchkit_ps2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
touchkit_ps2.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
trackpoint.c Input: trackpoint - use kobj_to_dev() 2021-06-19 22:36:26 -07:00
trackpoint.h Input: trackpoint - add new trackpoint variant IDs 2020-09-14 12:24:46 -07:00
vmmouse.c Input: vmmouse - disable vmmouse before entering suspend mode 2022-05-18 15:02:13 -07:00
vmmouse.h Input: psmouse - drop all unneeded functions from mouse headers 2019-08-20 14:15:36 -07:00
vsxxxaa.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00