WSL2-Linux-Kernel/drivers/acpi
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
..
acpica ACPICA: Allow address_space_handler Install and _REG execution as 2 separate steps 2022-12-08 17:38:28 +01:00
apei treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
arm64 ACPI: APMT: Fix kerneldoc and indentation 2022-11-15 13:09:44 +00:00
dptf ACPI: DPTF: Drop stale link from Kconfig help 2022-09-28 17:26:25 +02:00
nfit cxl for 6.2 2022-12-12 13:55:31 -08:00
numa MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
pmic
x86 ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 2022-12-08 15:32:53 +01:00
Kconfig ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
Makefile ACPI: Implement a generic FFH Opregion handler 2022-11-14 19:09:07 +01:00
ac.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
acpi_adxl.c
acpi_amba.c Merge branches 'acpi-ec', 'acpi-ac', 'acpi-fan', 'acpi-video' and 'acpi-amba' 2022-10-03 19:59:47 +02:00
acpi_apd.c ACPI: APD: Use the helper acpi_dev_get_memory_resources() 2022-09-10 18:22:24 +02:00
acpi_cmos_rtc.c
acpi_configfs.c
acpi_dbg.c
acpi_extlog.c ACPI: extlog: Handle multiple records 2022-10-13 20:43:10 +02:00
acpi_ffh.c ACPI: Implement a generic FFH Opregion handler 2022-11-14 19:09:07 +01:00
acpi_fpdt.c ACPI: tables: FPDT: Don't call acpi_os_map_memory() on invalid phys address 2022-09-10 18:18:34 +02:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c Revert "ACPI / PM: LPIT: Register sysfs attributes based on FADT" 2022-07-15 20:04:07 +02:00
acpi_lpss.c Merge branch 'acpi-uid' 2022-10-03 20:09:22 +02:00
acpi_memhotplug.c
acpi_pad.c Merge branches 'acpi-fan', 'acpi-pcc', 'acpi-misc' and 'pnp' 2022-12-12 15:24:15 +01:00
acpi_pcc.c ACPI: PCC: Setup PCC Opregion handler only if platform interrupt is available 2022-11-23 19:06:56 +01:00
acpi_platform.c Merge branches 'acpi-scan', 'acpi-bus' and 'acpi-platform' 2022-09-30 20:28:22 +02:00
acpi_pnp.c
acpi_processor.c
acpi_tad.c
acpi_video.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
acpi_watchdog.c
battery.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
bgrt.c
blacklist.c
bus.c ACPI updates for 6.2-rc1 2022-12-12 13:38:17 -08:00
button.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
container.c
cppc_acpi.c ACPI: use sysfs_emit() instead of scnprintf() 2022-12-02 20:24:55 +01:00
custom_method.c
debugfs.c
device_pm.c Merge branches 'acpi-apei', 'acpi-wakeup', 'acpi-reboot' and 'acpi-thermal' 2022-10-10 18:11:11 +02:00
device_sysfs.c
dock.c
ec.c Merge branch 'acpi-ec' 2022-12-15 18:38:22 +01:00
ec_sys.c
event.c
evged.c
fan.h
fan_attr.c ACPI: fan: Convert to use sysfs_emit_at() API 2022-12-06 12:44:14 +01:00
fan_core.c ACPI: fan: Bail out if extract package failed 2022-11-23 19:31:57 +01:00
glue.c
hed.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
internal.h ACPI: EC: Fix EC address space handler unregistration 2022-12-08 17:42:12 +01:00
ioapic.c
irq.c ACPI: irq: Fix some kernel-doc issues 2022-11-10 20:21:35 +01:00
nvs.c
osi.c ACPI: OSI: Remove Linux-HPI-Hybrid-Graphics _OSI string 2022-08-25 20:18:17 +02:00
osl.c
pci_irq.c ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity 2022-11-26 12:57:18 +00:00
pci_link.c ACPI/PCI: Remove useless NULL pointer checks 2022-07-27 21:21:27 +02:00
pci_mcfg.c
pci_root.c cxl/acpi: Set ACPI's CXL _OSC to indicate RCD mode support 2022-12-05 10:32:26 -08:00
pci_slot.c
pfr_telemetry.c ACPI: pfr_telemetry: use ACPI_FREE() to free acpi_object 2022-11-23 19:23:25 +01:00
pfr_update.c iov_iter work; most of that is about getting rid of 2022-12-12 18:29:54 -08:00
platform_profile.c
power.c ACPI: PM: Print full name path while adding power resource 2022-11-10 20:43:30 +01:00
pptt.c ACPI: PPTT: Leave the table mapped for the runtime usage 2022-07-22 10:04:43 +02:00
prmt.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor: idle: Drop unnecessary statements and parens 2022-12-07 18:07:15 +01:00
processor_pdc.c
processor_perflib.c ACPI: processor: perflib: Adjust acpi_processor_notify_smm() return value 2022-12-07 18:09:39 +01:00
processor_thermal.c ACPI: processor: Remove freq Qos request for all CPUs 2022-08-23 18:09:06 +02:00
processor_throttling.c ACPI: processor: throttling: remove variable count 2022-10-28 19:02:45 +02:00
property.c Merge branch 'acpi-dev' 2022-09-30 20:05:16 +02:00
reboot.c
resource.c ACPI: resource: Skip IRQ override on Asus Vivobook S5602ZA 2022-10-26 13:41:11 +02:00
sbs.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
sbshc.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
sbshc.h
scan.c ACPI: scan: substitute empty_zero_page with helper ZERO_PAGE(0) 2022-11-03 19:51:52 +01:00
sleep.c PM: ACPI: reboot: Reinstate S5 for reboot 2022-10-04 15:59:36 +02:00
sleep.h ACPI: s2idle: Add a new ->check() callback for platform_s2idle_ops 2022-09-09 17:37:40 +02:00
spcr.c
sysfs.c ACPI: sysfs: use sysfs_emit() to instead of scnprintf() 2022-11-10 20:24:49 +01:00
tables.c ACPI: tables: Fix the stale comments for acpi_locate_initial_tables() 2022-11-10 20:15:55 +01:00
thermal.c Merge branches 'acpi-scan', 'acpi-bus', 'acpi-tables' and 'acpi-sysfs' 2022-12-12 14:55:44 +01:00
tiny-power-button.c ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
utils.c Merge branch 'acpi-uid' 2022-10-03 20:09:22 +02:00
video_detect.c ACPI: video: Prefer native over vendor 2022-11-16 19:52:48 +01:00
viot.c iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
wakeup.c