Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings

This functions retrieves values by passing a pointer. As the function
that retrieves them can fail before touching the pointers, the variables
must be initialized.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20240619132816.11526-1-oneukum@suse.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Oliver Neukum and committed by
Jakub Kicinski
fba38398 48dea8f7

+2 -1
+2 -1
drivers/net/usb/rtl8150.c
··· 778 778 struct ethtool_link_ksettings *ecmd) 779 779 { 780 780 rtl8150_t *dev = netdev_priv(netdev); 781 - short lpa, bmcr; 781 + short lpa = 0; 782 + short bmcr = 0; 782 783 u32 supported; 783 784 784 785 supported = (SUPPORTED_10baseT_Half |