linux-stable/drivers/net
Kees Cook d68627697d 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:33:32 +02:00
..
appletalk net: appletalk: cops: Fix data race in cops_probe1 2021-06-16 11:53:01 +02:00
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-08 19:01:57 +01:00
bonding bonding: uninitialized variable in bond_miimon_inspect() 2023-01-18 09:26:15 +01:00
caif caif_virtio: fix race between virtio_device_ready() and ndo_open() 2022-07-07 17:31:17 +02:00
can treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
cris
dsa net: dsa: mv88e6xxx: Increase wait after reset deactivation 2023-06-09 10:22:49 +02:00
ethernet treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
fddi net: defxx: Fix missing err handling in dfx_init() 2023-01-18 09:26:18 +01:00
fjes fjes: Check for error irq 2021-12-29 12:17:34 +01:00
hamradio hamradio: baycom_epp: Fix return type of baycom_send_packet() 2023-01-18 09:26:31 +01:00
hippi drivers: net: hippi: Fix deadlock in rr_close() 2022-05-12 12:17:08 +02:00
hyperv
ieee802154 ca8210: Fix unsigned mac_len comparison with zero in ca8210_skb_tx() 2023-04-05 11:14:22 +02:00
ipvlan ipvlan:Fix out-of-bounds caused by unclear skb->cb 2023-05-30 12:38:34 +01:00
phy net: mdio: thunder: Add missing fwnode_handle_put() 2023-04-05 11:14:16 +02:00
plip net: plip: don't call kfree_skb/dev_kfree_skb() under spin_lock_irq() 2022-12-14 11:26:15 +01:00
ppp ppp: associate skb with a device at tx 2023-01-18 09:26:32 +01:00
slip drivers: net: slip: fix NPD bug in sl_tx_timeout() 2022-04-20 09:08:32 +02:00
team net: team: Unsync device addresses on ndo_stop 2022-09-28 10:56:51 +02:00
usb net: usb: qmi_wwan: add support for Compal RXM-G1 2023-06-21 15:38:58 +02:00
vmxnet3 net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup() 2022-05-25 08:41:19 +02:00
wan treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
wimax staging: wimax/i2400m: fix byte-order issue 2021-05-22 10:57:16 +02:00
wireless treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
xen-netback xen/netback: Fix buffer overrun triggered by unusual packet 2023-08-08 19:48:25 +02:00
Kconfig
LICENSE.SRC
Makefile
Space.c
dummy.c
eql.c
geneve.c geneve: do not use RT_TOS for IPv6 flowlabel 2022-08-25 11:11:33 +02:00
gtp.c
ifb.c
loopback.c net: loopback: use NET_NAME_PREDICTABLE for name_assign_type 2023-01-18 09:26:07 +01:00
macsec.c net: macsec: Verify that send_sci is on when setting Tx sci explicitly 2022-02-08 18:16:29 +01:00
macvlan.c macvlan: enforce a consistent minimal mtu 2022-11-25 17:36:54 +01:00
macvtap.c macvtap: advertise link netns via netlink 2022-04-20 09:08:27 +02:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c ntb_netdev: Use dev_kfree_skb_any() in interrupt context 2023-01-18 09:26:20 +01:00
rionet.c
sb1000.c
sungem_phy.c net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-08-25 11:11:09 +02:00
tap.c
tun.c tun: fix bonding active backup with arp monitoring 2021-11-26 11:40:40 +01:00
veth.c veth: Ensure eth header is in skb's linear part 2022-04-20 09:08:31 +02:00
virtio_net.c virtio_net: bugfix overflow inside xdp_linearize_page() 2023-04-26 11:18:55 +02:00
vrf.c vrf: Reset IPCB/IP6CB when processing outbound pkts in vrf dev xmit 2021-12-08 08:46:54 +01:00
vsockmon.c
vxlan.c vxlan: fix error return code in vxlan_fdb_append 2022-04-27 13:15:30 +02:00
xen-netfront.c xen/netfront: force data bouncing when backend is untrusted 2022-07-07 17:31:18 +02:00