linux-stable/drivers/media/usb
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
..
airspy media: airspy: fix memory leak in airspy probe 2022-08-30 07:31:42 +02:00
as102
au0828 media: vb2/au0828: move the v4l_vb2q_enable_media_source to the au0828 driver 2022-11-25 07:41:40 +00:00
b2c2 media: flexcop-usb: use usb_endpoint_maxp() 2022-09-26 10:59:25 +02:00
cx231xx media: avoid use of 'videobuf' 2022-08-29 16:27:18 +02:00
dvb-usb media: dvb-usb: m920x: make read-only arrays static const 2022-12-02 15:36:44 +01:00
dvb-usb-v2 media: usb/dvb-usb-v2: fix repeated words in comments 2022-09-24 08:47:01 +02:00
em28xx media: dvb-frontends: a8293: fix LNB powerup failure in PCTV 461e 2022-11-25 09:55:55 +00:00
go7007 media: usb: go7007: s2250-board: Convert to i2c's .probe_new() 2022-11-21 11:04:46 +01:00
gspca media: gspca: Fix typo 'the the' in comment 2022-08-29 15:32:14 +02:00
hackrf media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
hdpvr media: hdpvr: fix error value returns in hdpvr_read 2022-06-27 09:02:50 +01:00
msi2500 media: usb/msi2500: fix repeated words in comments 2022-09-24 08:46:38 +02:00
pvrusb2 treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
pwc media: usb: pwc-uncompress: Use flex array destination for memcpy() 2022-12-07 17:58:46 +01:00
s2255 treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
siano media: siano: remove duplicate USB device IDs 2021-12-07 11:29:58 +01:00
stk1160 media: stk1160: use dma_alloc_noncontiguous API 2022-03-07 11:01:22 +01:00
ttusb-budget
ttusb-dec media: ttusb-dec: avoid release of non-acquired mutex 2021-09-30 10:07:40 +02:00
usbtv media: usbtv: Add PAL-Nc standard 2022-06-20 10:30:30 +01:00
uvc media: Switch to use dev_err_probe() helper 2022-12-07 17:58:46 +01:00
Kconfig media: tm6000: deprecate this driver 2022-08-29 16:43:00 +02:00
Makefile media: tm6000: deprecate this driver 2022-08-29 16:43:00 +02:00