Kees Cook
0638dcc7e7
treewide: Remove uninitialized_var() usage
commit 3f649ab728cda8038259d8f14492fe400fbab911 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/[email protected]/
[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 <[email protected]> # drivers/infiniband and mlx4/mlx5
Acked-by: Jason Gunthorpe <[email protected]> # IB
Acked-by: Kalle Valo <[email protected]> # wireless drivers
Reviewed-by: Chao Yu <[email protected]> # erofs
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
2023-06-09 10:29:01 +02:00 |
| .. |
|
aec62xx.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ali14xx.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
alim15x3.c
|
|
|
|
amd74xx.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
|
2019-06-19 17:09:55 +02:00 |
|
atiixp.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
au1xxx-ide.c
|
|
|
|
buddha.c
|
|
|
|
cmd64x.c
|
cmd64x: potential buffer overflow in cmd64x_program_timings()
|
2020-02-24 08:36:53 +01:00 |
|
cmd640.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
cs5520.c
|
|
|
|
cs5530.c
|
|
|
|
cs5535.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
|
2019-06-19 17:09:55 +02:00 |
|
cs5536.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333
|
2019-06-05 17:37:06 +02:00 |
|
cy82c693.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
delkin_cb.c
|
|
|
|
dtc2278.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
falconide.c
|
|
|
|
gayle.c
|
|
|
|
hpt366.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ht6560b.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
icside.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-4drives.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-acpi.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
ide-atapi.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
ide-cd.c
|
docs: cdrom: convert docs to ReST and rename to *.rst
|
2019-06-14 14:20:46 -06:00 |
|
ide-cd.h
|
|
|
|
ide-cd_ioctl.c
|
Revert "ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd"
|
2019-04-12 13:35:25 -06:00 |
|
ide-cd_verbose.c
|
|
|
|
ide-cs.c
|
|
|
|
ide-devsets.c
|
|
|
|
ide-disk.c
|
|
|
|
ide-disk.h
|
|
|
|
ide-disk_ioctl.c
|
|
|
|
ide-disk_proc.c
|
|
|
|
ide-dma-sff.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-dma.c
|
|
|
|
ide-eh.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-floppy.c
|
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
|
2019-03-11 09:34:00 -07:00 |
|
ide-floppy.h
|
|
|
|
ide-floppy_ioctl.c
|
|
|
|
ide-floppy_proc.c
|
|
|
|
ide-gd.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-gd.h
|
|
|
|
ide-generic.c
|
|
|
|
ide-io-std.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
ide-io.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
ide-ioctls.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-iops.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-legacy.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-lib.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-park.c
|
ide: ensure atapi sense request aren't preempted
|
2019-01-31 08:25:09 -07:00 |
|
ide-pci-generic.c
|
|
|
|
ide-pio-blacklist.c
|
|
|
|
ide-pm.c
|
|
|
|
ide-pnp.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 47
|
2019-05-24 17:27:13 +02:00 |
|
ide-probe.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-proc.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-scan-pci.c
|
|
|
|
ide-sysfs.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
ide-tape.c
|
|
|
|
ide-taskfile.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide-timings.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
|
2019-05-30 11:26:35 -07:00 |
|
ide-xfer-mode.c
|
treewide: Add SPDX license identifier for missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
ide_platform.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
|
2019-05-30 11:26:32 -07:00 |
|
it821x.c
|
|
|
|
it8172.c
|
|
|
|
it8213.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
jmicron.c
|
|
|
|
Kconfig
|
ide: remove the sgiioc4 driver
|
2019-08-16 11:33:56 -07:00 |
|
macide.c
|
|
|
|
Makefile
|
ide: remove the sgiioc4 driver
|
2019-08-16 11:33:56 -07:00 |
|
ns87415.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
opti621.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
palm_bk3710.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
|
2019-05-24 17:36:45 +02:00 |
|
pdc202xx_new.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
|
2019-05-30 11:26:32 -07:00 |
|
pdc202xx_old.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
piix.c
|
|
|
|
pmac.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
|
2019-05-30 11:26:32 -07:00 |
|
q40ide.c
|
|
|
|
qd65xx.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
qd65xx.h
|
|
|
|
rapide.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
rz1000.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
sc1200.c
|
|
|
|
serverworks.c
|
ide: serverworks: potential overflow in svwks_set_pio_mode()
|
2020-02-24 08:36:53 +01:00 |
|
setup-pci.c
|
|
|
|
siimage.c
|
|
|
|
sis5513.c
|
|
|
|
sl82c105.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
slc90e66.c
|
treewide: Add SPDX license identifier for more missed files
|
2019-05-21 10:50:45 +02:00 |
|
tc86c001.c
|
|
|
|
triflex.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333
|
2019-06-05 17:37:06 +02:00 |
|
trm290.c
|
|
|
|
tx4938ide.c
|
|
|
|
tx4939ide.c
|
drivers: Remove explicit invocations of mmiowb()
|
2019-04-08 12:01:02 +01:00 |
|
umc8672.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
via82cxxx.c
|
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
|
2019-06-19 17:09:55 +02:00 |