OpenCloudOS-Kernel/drivers/media/pci/ivtv
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
..
Kconfig media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
Makefile media: don't include drivers/media/i2c at cflags 2017-12-28 14:14:09 -05:00
ivtv-alsa-main.c media: ivtv: drop an unused macro 2021-11-22 08:29:50 +00:00
ivtv-alsa-pcm.c media: ivtv: Drop superfluous ioctl PCM ops 2019-12-13 09:33:16 +01:00
ivtv-alsa-pcm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ivtv-alsa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ivtv-cards.c media: ivtv: Replace http links with https ones 2020-07-19 14:00:32 +02:00
ivtv-cards.h media: ivtv: prevent going past the hw arrays 2021-07-12 09:16:31 +02:00
ivtv-controls.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-controls.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-driver.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
ivtv-driver.h ivtv: fix incorrect device_caps for ivtvfb 2022-03-07 17:21:53 +01:00
ivtv-fileops.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-fileops.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-firmware.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-firmware.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-gpio.c media: xc2028: rename the driver from tuner-xc2028 2022-03-12 16:59:50 +01:00
ivtv-gpio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-i2c.c media: ivtv: prevent going past the hw arrays 2021-07-12 09:16:31 +02:00
ivtv-i2c.h media: pci: ivtv: convert to i2c_new_scanned_device 2020-01-08 14:33:04 +01:00
ivtv-ioctl.c media: v4l: ioctl: Set bus_info in v4l_querycap() 2022-04-24 08:07:08 +01:00
ivtv-ioctl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-irq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-irq.h media: use the BIT() macro 2019-08-26 14:08:50 -03:00
ivtv-mailbox.c media: remove include stdarg.h from some drivers 2019-08-26 14:01:44 -03:00
ivtv-mailbox.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-queue.c media: pci/ivtv: switch from 'pci_' to 'dma_' API 2021-09-30 10:07:55 +02:00
ivtv-queue.h media: Remove usage of the deprecated "pci-dma-compat.h" API 2022-03-07 11:50:29 +01:00
ivtv-routing.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-routing.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-streams.c ivtv: fix incorrect device_caps for ivtvfb 2022-03-07 17:21:53 +01:00
ivtv-streams.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-udma.c media: pci/ivtv: remove FOLL_FORCE usage 2022-11-30 15:58:59 -08:00
ivtv-udma.h media: Remove usage of the deprecated "pci-dma-compat.h" API 2022-03-07 11:50:29 +01:00
ivtv-vbi.c media: media/pci/ivtv: Variable vbi.type could be uninitialized if macro v4l2_subdev_call set __result an error code 2019-10-10 07:15:09 -03:00
ivtv-vbi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-version.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtv-yuv.c media: pci/ivtv: remove FOLL_FORCE usage 2022-11-30 15:58:59 -08:00
ivtv-yuv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ivtvfb.c media: ivtv: no need to initialise statics to 0 2021-12-14 16:19:04 +01:00