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 |
| .. |
|
partitions
|
|
|
|
badblocks.c
|
|
|
|
bfq-cgroup.c
|
block, bfq: fix null pointer dereference in bfq_bio_bfqg()
|
2022-12-08 11:22:57 +01:00 |
|
bfq-iosched.c
|
block, bfq: protect 'bfqd->queued' by 'bfqd->lock'
|
2022-11-10 17:57:54 +01:00 |
|
bfq-iosched.h
|
bfq: Get rid of __bio_blkcg() usage
|
2022-06-14 18:11:50 +02:00 |
|
bfq-wf2q.c
|
bfq: fix blkio cgroup leakage v4
|
2020-09-03 11:26:54 +02:00 |
|
bio-integrity.c
|
block: bio-integrity: Copy flags when bio_integrity_payload is cloned
|
2023-03-11 16:43:35 +01:00 |
|
bio.c
|
block: fix bio_clone_blkg_association() to associate with proper blkcg_gq
|
2022-06-14 18:11:50 +02:00 |
|
blk-cgroup.c
|
blk-cgroup: fix missing pd_online_fn() while activating policy
|
2023-02-06 07:52:48 +01:00 |
|
blk-core.c
|
block: fix and cleanup bio_check_ro
|
2023-02-06 07:52:47 +01:00 |
|
blk-exec.c
|
|
|
|
blk-flush.c
|
block: Fix fsync always failed if once failed
|
2022-03-08 19:07:47 +01:00 |
|
blk-integrity.c
|
|
|
|
blk-ioc.c
|
|
|
|
blk-iocost.c
|
blk-iocost: fix divide by 0 error in calc_lcoefs()
|
2023-03-11 16:43:54 +01:00 |
|
blk-iolatency.c
|
blk-iolatency: Fix inflight count imbalances and IO hangs on offline
|
2022-06-14 18:11:49 +02:00 |
|
blk-lib.c
|
|
|
|
blk-map.c
|
|
|
|
blk-merge.c
|
treewide: Remove uninitialized_var() usage
|
2023-06-09 10:29:01 +02:00 |
|
blk-mq-cpumap.c
|
|
|
|
blk-mq-debugfs-zoned.c
|
|
|
|
blk-mq-debugfs.c
|
blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created
|
2022-08-25 11:17:36 +02:00 |
|
blk-mq-debugfs.h
|
|
|
|
blk-mq-pci.c
|
|
|
|
blk-mq-rdma.c
|
|
|
|
blk-mq-sched.c
|
blk-mq: correct stale comment of .get_budget
|
2023-03-11 16:43:34 +01:00 |
|
blk-mq-sched.h
|
block: only call sched requeue_request() for scheduled requests
|
2020-09-23 12:40:37 +02:00 |
|
blk-mq-sysfs.c
|
blk-mq: fix possible memleak when register 'hctx' failed
|
2023-01-18 11:41:38 +01:00 |
|
blk-mq-tag.c
|
|
|
|
blk-mq-tag.h
|
|
|
|
blk-mq-virtio.c
|
|
|
|
blk-mq.c
|
blk-mq: wait on correct sbitmap_queue in blk_mq_mark_tag_wait
|
2023-03-11 16:43:34 +01:00 |
|
blk-mq.h
|
|
|
|
blk-pm.c
|
scsi: block: Fix a race in the runtime power management code
|
2021-01-06 14:48:37 +01:00 |
|
blk-pm.h
|
|
|
|
blk-rq-qos.c
|
rq-qos: fix missed wake-ups in rq_qos_throttle try two
|
2021-07-19 08:53:16 +02:00 |
|
blk-rq-qos.h
|
block: fix race between adding/removing rq qos and normal IO
|
2021-07-14 16:53:18 +02:00 |
|
blk-settings.c
|
blk-settings: align max_sectors on "logical_block_size" boundary
|
2021-03-04 10:26:40 +01:00 |
|
blk-softirq.c
|
|
|
|
blk-stat.c
|
|
|
|
blk-stat.h
|
|
|
|
blk-sysfs.c
|
block: don't delete queue kobject before its children
|
2022-04-15 14:18:05 +02:00 |
|
blk-throttle.c
|
blk-throttle: fix UAF by deleteing timer in blk_throtl_exit()
|
2021-09-26 14:07:13 +02:00 |
|
blk-timeout.c
|
|
|
|
blk-wbt.c
|
blk-wbt: make sure throttle is enabled properly
|
2021-07-14 16:53:25 +02:00 |
|
blk-wbt.h
|
blk-wbt: introduce a new disable state to prevent false positive by rwb_enabled()
|
2021-07-14 16:53:25 +02:00 |
|
blk-zoned.c
|
blk-zoned: allow BLKREPORTZONE without CAP_SYS_ADMIN
|
2021-09-22 12:26:19 +02:00 |
|
blk.h
|
|
|
|
bounce.c
|
|
|
|
bsg-lib.c
|
|
|
|
bsg.c
|
scsi: bsg: Remove support for SCSI_IOCTL_SEND_COMMAND
|
2021-09-22 12:26:23 +02:00 |
|
cmdline-parser.c
|
|
|
|
compat_ioctl.c
|
block/compat_ioctl: fix range check in BLKGETSIZE
|
2022-04-27 13:50:50 +02:00 |
|
elevator.c
|
block: return ELEVATOR_DISCARD_MERGE if possible
|
2022-05-25 09:14:38 +02:00 |
|
genhd.c
|
block: Suppress uevent for hidden device when removed
|
2021-03-30 14:35:23 +02:00 |
|
ioctl.c
|
|
|
|
ioprio.c
|
block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2)
|
2021-12-14 14:49:02 +01:00 |
|
Kconfig
|
|
|
|
Kconfig.iosched
|
|
|
|
kyber-iosched.c
|
kyber: fix out of bounds access when preempted
|
2021-05-19 10:08:30 +02:00 |
|
Makefile
|
|
|
|
mq-deadline.c
|
block: return ELEVATOR_DISCARD_MERGE if possible
|
2022-05-25 09:14:38 +02:00 |
|
opal_proto.h
|
|
|
|
partition-generic.c
|
block: unhash blkdev part inode when the part is deleted
|
2022-12-19 12:24:16 +01:00 |
|
scsi_ioctl.c
|
|
|
|
sed-opal.c
|
block: sed-opal: kmalloc the cmd/resp buffers
|
2022-11-25 17:42:14 +01:00 |
|
t10-pi.c
|
|
|