]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings
authorOliver Neukum <oneukum@suse.com>
Wed, 19 Jun 2024 13:28:03 +0000 (15:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:08:23 +0000 (09:08 +0200)
[ Upstream commit fba383985354e83474f95f36d7c65feb75dba19d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/usb/rtl8150.c

index 491625c1c3084932cce892ce78afbfa94c3d3b10..387091cb91340a233ec7e98393365b91cfba3af7 100644 (file)
@@ -798,7 +798,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev,
                                      struct ethtool_link_ksettings *ecmd)
 {
        rtl8150_t *dev = netdev_priv(netdev);
-       short lpa, bmcr;
+       short lpa = 0;
+       short bmcr = 0;
        u32 supported;
 
        supported = (SUPPORTED_10baseT_Half |