linux-stable/drivers/acpi
Kees Cook b7e389235c treewide: Remove uninitialized_var() usage
commit 3f649ab728 upstream.

Using uninitialized_var() is dangerous as it papers over real bugs[1]
(or can in the future), and suppresses unrelated compiler warnings
(e.g. "unused variable"). If the compiler thinks it is uninitialized,
either simply initialize the variable or make compiler changes.

In preparation for removing[2] the[3] macro[4], remove all remaining
needless uses with the following script:

git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
	xargs perl -pi -e \
		's/\buninitialized_var\(([^\)]+)\)/\1/g;
		 s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
pathological white-space.

No outstanding warnings were found building allmodconfig with GCC 9.3.0
for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
alpha, and m68k.

[1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
[2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
[3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
[4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

Reviewed-by: Leon Romanovsky <leonro@mellanox.com> # drivers/infiniband and mlx4/mlx5
Acked-by: Jason Gunthorpe <jgg@mellanox.com> # IB
Acked-by: Kalle Valo <kvalo@codeaurora.org> # wireless drivers
Reviewed-by: Chao Yu <yuchao0@huawei.com> # erofs
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 11:45:01 +02:00
..
acpica ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects 2023-05-30 12:42:08 +01:00
apei ACPI/APEI: Limit printable size of BERT table data 2022-04-15 14:14:54 +02:00
arm64 acpi/arm64: fix next_platform_timer() section mismatch error 2021-10-20 11:23:04 +02:00
dptf
nfit ACPI: NFIT: fix a potential deadlock during NFIT teardown 2023-03-03 11:40:07 +01:00
pmic ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses 2021-11-26 11:36:16 +01:00
x86 x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
ac.c
acpi_amba.c ACPI: AMBA: Fix resource name in /proc/iomem 2021-07-20 16:16:12 +02:00
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c ACPI: configfs: add missing check after configfs_register_default_group() 2021-03-04 09:39:51 +01:00
acpi_dbg.c ACPI: debug: don't allow debugging when ACPI is disabled 2020-11-05 11:08:47 +01:00
acpi_extlog.c ACPI: extlog: Handle multiple records 2022-11-03 23:52:25 +09:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c ACPI: LPSS: Fix missing check in register_device_clock() 2022-08-25 11:14:59 +02:00
acpi_memhotplug.c mm/memory_hotplug: make remove_memory() take the device_hotplug_lock 2020-01-29 16:43:24 +01:00
acpi_pad.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
acpi_platform.c
acpi_pnp.c ACPI: PNP: compare the string length in the matching_id() 2020-12-30 11:26:08 +01:00
acpi_processor.c ACPI / processor: don't print errors for processorIDs == 0xff 2019-10-05 13:09:38 +02:00
acpi_tad.c
acpi_video.c ACPI: video: Add Toshiba Satellite/Portege Z830 quirk 2022-10-26 13:19:35 +02:00
acpi_watchdog.c ACPI: watchdog: Allow disabling WDAT at boot 2020-03-20 11:55:52 +01:00
battery.c ACPI: battery: Fix missing NUL-termination with large strings 2023-03-11 16:31:36 +01:00
bgrt.c
blacklist.c ACPI: blacklist: fix clang warning for unused DMI table 2019-08-06 19:06:50 +02:00
bus.c ACPI: bus: Call kobject_put() in acpi_init() error path 2021-07-20 16:15:46 +02:00
button.c ACPI: button: Add DMI quirk for Medion Akoya E2228T 2020-11-24 13:27:19 +01:00
cm_sbs.c
container.c
cppc_acpi.c ACPI: CPPC: Do not prevent CPPC from working in the future 2022-08-25 11:15:30 +02:00
custom_method.c ACPI: custom_method: fix a possible memory leak 2021-05-22 10:59:12 +02:00
debugfs.c
device_pm.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2020-12-30 11:26:08 +01:00
device_sysfs.c ACPI: sysfs: Fix a buffer overrun problem with description_show() 2021-07-20 16:15:48 +02:00
dock.c
ec.c ACPI: EC: Fix oops when removing custom query handlers 2023-05-30 12:42:08 +01:00
ec_sys.c
event.c
evged.c ACPI: GED: fix -Wformat 2020-11-22 10:02:26 +01:00
fan.c
glue.c
hed.c
internal.h ACPI: scan: Use unique number for instance_no 2021-03-30 14:37:02 +02:00
ioapic.c
irq.c
Kconfig
Makefile ACPI: tables: Add custom DSDT file as makefile prerequisite 2021-07-20 16:15:46 +02:00
numa.c ACPI: Add out of bounds and numa_off protections to pxm_to_node() 2020-11-05 11:08:42 +01:00
nvs.c
osi.c
osl.c ACPI: OSL: only free map once in osl.c 2019-12-17 20:35:05 +01:00
pci_irq.c ACPI / PCI: fix acpi_pci_irq_enable() memory leak 2019-10-05 13:09:53 +02:00
pci_link.c
pci_mcfg.c
pci_root.c PCI/ACPI: Correct error message for ASPM disabling 2019-11-20 18:46:52 +01:00
pci_slot.c
power.c
pptt.c ACPI/PPTT: Add support for ACPI 6.3 thread flag 2019-10-17 13:45:34 -07:00
proc.c
processor_core.c
processor_driver.c
processor_idle.c ACPI: processor idle: Fix up C-state latency if not ordered 2021-07-20 16:15:45 +02:00
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c x86: ACPI: fix CPU hotplug deadlock 2020-04-23 10:30:20 +02:00
property.c ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool 2022-08-25 11:15:38 +02:00
reboot.c
resource.c Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks" 2020-12-30 11:26:08 +01:00
sbs.c ACPI / SBS: Fix GPE storm on recent MacBookPro's 2019-04-20 09:16:01 +02:00
sbshc.c ACPI / SBS: Fix rare oops when removing modules 2019-11-24 08:20:31 +01:00
sbshc.h
scan.c ACPI: scan: Fix a memory leak in an error handling path 2021-05-22 10:59:45 +02:00
sleep.c ACPI: PM: save NVS memory for Lenovo G40-45 2022-08-25 11:14:59 +02:00
sleep.h
spcr.c
sysfs.c ACPI: sysfs: Fix BERT error region memory mapping 2022-06-06 08:24:20 +02:00
tables.c ACPI: tables: x86: Reserve memory occupied by ACPI tables 2021-05-07 10:49:25 +02:00
thermal.c ACPI: thermal: drop an always true check 2023-06-09 10:24:02 +02:00
utils.c ACPI / utils: Drop reference in test for device presence 2019-04-20 09:15:58 +02:00
video_detect.c ACPI: video: Fix Lenovo Ideapad Z570 DMI match 2023-03-11 16:31:47 +01:00
wakeup.c