diff options
author | Valentin Vidic <vvidic@valentin-vidic.from.hr> | 2019-10-15 22:20:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-06 13:06:26 +0100 |
commit | 3ecf8529d52ac62b1224e7c96f52bb059efde057 (patch) | |
tree | d0f6c392995e35d192cc9cf8cec2e0b437634b83 /drivers/net | |
parent | 14a703ef2dc4671ff8a13a166c98ac6bb7381f72 (diff) | |
download | linux-stable-3ecf8529d52ac62b1224e7c96f52bb059efde057.tar.gz linux-stable-3ecf8529d52ac62b1224e7c96f52bb059efde057.tar.bz2 linux-stable-3ecf8529d52ac62b1224e7c96f52bb059efde057.zip |
net: usb: sr9800: fix uninitialized local variable
commit 77b6d09f4ae66d42cd63b121af67780ae3d1a5e9 upstream.
Make sure res does not contain random value if the call to
sr_read_cmd fails for some reason.
Reported-by: syzbot+f1842130bbcfb335bac1@syzkaller.appspotmail.com
Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/sr9800.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c index 35f39f23d881..8f8c9ede88c2 100644 --- a/drivers/net/usb/sr9800.c +++ b/drivers/net/usb/sr9800.c @@ -336,7 +336,7 @@ static void sr_set_multicast(struct net_device *net) static int sr_mdio_read(struct net_device *net, int phy_id, int loc) { struct usbnet *dev = netdev_priv(net); - __le16 res; + __le16 res = 0; mutex_lock(&dev->phy_mutex); sr_set_sw_mii(dev); |