OpenCloudOS-Kernel/drivers/usb/gadget/udc
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
..
aspeed-vhub usb: gadget: aspeed: fix buffer overflow 2022-11-09 12:36:57 +01:00
bdc usb: bdc: change state when port disconnected 2022-10-22 12:51:53 +02:00
Kconfig usb: gadget: udc: drop obsolete dependencies on COMPILE_TEST 2022-12-08 16:44:49 +01:00
Makefile usb: fotg210: Collect pieces of dual mode controller 2022-11-09 12:38:09 +01:00
amd5536udc.h USB: gadget: udc: Remove some dead code 2021-10-10 15:12:34 +02:00
amd5536udc_pci.c usb: gadget: udc: amd5536udc_pci fix null-ptr-dereference 2021-03-23 13:25:07 +01:00
aspeed_udc.c usb: gadget: aspeed_udc: fix handling of tx_len == 0 2022-06-29 21:01:54 +02:00
at91_udc.c usb: gadget: at91-udc: simplify at91rm9200_udc_pullup callback 2022-11-09 11:43:11 +01:00
at91_udc.h usb: gadget: at91_udc: Convert to GPIO descriptors 2021-11-17 14:41:15 +01:00
atmel_usba_udc.c usb: gadget: udc: atmel: convert to platform driver 2022-07-08 14:49:33 +02:00
atmel_usba_udc.h usb: gadget: udc: atmel: update endpoint allocation for sam9x60 2020-09-24 11:56:17 +03:00
bcm63xx_udc.c Revert "usb: gadget: udc: bcm63xx: Convert to use list_count()" 2022-11-30 12:06:51 +01:00
core.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
dummy_hcd.c usb: gadget: eliminate anonymous module_init & module_exit 2022-03-18 12:53:18 +01:00
fsl_qe_udc.c usb: gadget: fsl_qe_udc: Add missing semicolon in qe_ep_dequeue() 2022-03-19 13:46:06 +01:00
fsl_qe_udc.h usb: Spelling s/enpoint/endpoint/ 2019-11-04 15:53:00 +01:00
fsl_udc_core.c usb: gadget: fsl: remove usage of list iterator past the loop body 2022-03-15 18:19:43 +01:00
fsl_usb2_udc.h usb: gadget: fsl: properly remove remnant of MXC support 2021-06-14 10:31:51 +02:00
fusb300_udc.c usb: gadget: fusb300_udc: remove useless cast for driver.name 2020-02-19 11:10:25 +01:00
fusb300_udc.h
goku_udc.c usb: gadget: goku_udc: remove usage of list iterator past the loop body 2022-03-15 18:19:43 +01:00
goku_udc.h
gr_udc.c usb: gadget: udc: gr_udc: remove usage of list iterator past the loop body 2022-03-15 18:19:43 +01:00
gr_udc.h USB: gr_udc: remove dentry storage for debugfs file 2021-06-02 16:41:00 +02:00
lpc32xx_udc.c usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe 2022-06-10 11:12:39 +02:00
m66592-udc.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
m66592-udc.h
max3420_udc.c USB/Thunderbolt patches for 5.18-rc1 2022-03-26 13:08:25 -07:00
mv_u3d.h usb: Spelling s/enpoint/endpoint/ 2019-11-04 15:53:00 +01:00
mv_u3d_core.c usb: gadget: mv_u3d: remove usage of list iterator past the loop body 2022-03-15 18:19:44 +01:00
mv_udc.h
mv_udc_core.c usb: gadget: udc: mv_udc_core: remove usage of list iterator past the loop body 2022-03-15 18:19:44 +01:00
net2272.c usb: gadget: net2272: Remove the initialization of statics to 0 2022-08-31 09:07:52 +02:00
net2272.h USB: UDC: Implement udc_async_callbacks in net2272 2021-06-04 13:52:09 +02:00
net2280.c usb: gadget: net2280: use swap() instead of open coding it 2022-04-21 19:03:11 +02:00
net2280.h USB: UDC: Implement udc_async_callbacks in net2280 2021-06-04 13:52:06 +02:00
omap_udc.c USB: omap_udc: Fix spelling mistake: "tranceiver_ctrl" -> "transceiver_ctrl" 2022-09-30 13:55:36 +02:00
omap_udc.h
pch_udc.c usb: gadget: pch_udc: Convert Intel Quark quirk to use driver data 2021-03-26 14:44:17 +01:00
pxa25x_udc.c ARM: pxa: lubbock: pass udc irqs as resource 2022-05-07 22:55:47 +02:00
pxa25x_udc.h ARM: pxa: lubbock: pass udc irqs as resource 2022-05-07 22:55:47 +02:00
pxa27x_udc.c usb: gadget: pxa27x_udc: replace usage of rc to check if a list element was found 2022-03-15 18:19:45 +01:00
pxa27x_udc.h usb: gadget: pxa27x_udc: clean up comment 2022-04-21 19:20:42 +02:00
r8a66597-udc.c usb: gadget: r8a66597: fix a loop in set_feature() 2021-09-14 10:32:27 +02:00
r8a66597-udc.h
renesas_usb3.c usb: gadget: udc: renesas_usb3: Add support for RZ/V2M 2022-08-19 11:05:34 +02:00
s3c-hsudc.c usb: gadget: s3c-hsudc: clean up comments 2022-04-21 19:20:42 +02:00
s3c2410_udc.c USB/ARM: Switch S3C2410 UDC to GPIO descriptors 2022-09-07 16:23:54 +02:00
s3c2410_udc.h USB/ARM: Switch S3C2410 UDC to GPIO descriptors 2022-09-07 16:23:54 +02:00
s3c2410_udc_regs.h usb: gadget: s3c: use platform resources 2020-08-19 20:58:22 +02:00
snps_udc_core.c usb: gadget: udc: fix typos in comments 2022-03-15 15:24:24 +01:00
snps_udc_plat.c USB: gadget: udc: Remove some dead code 2021-10-10 15:12:34 +02:00
tegra-xudc.c usb: gadget: tegra: Reduce pad power 2022-08-19 11:10:08 +02:00
trace.c USB: gadget: udc: fix kernel-doc syntax in file headers 2021-05-24 15:27:03 +02:00
trace.h USB: gadget: udc: tracing: Do not open code __string() with __dynamic_array() 2022-07-08 14:48:50 +02:00
udc-xilinx.c Revert "usb: gadget: udc-xilinx: replace memcpy with memcpy_toio" 2022-09-02 09:10:08 +02:00