Commit b56f9d8d authored by Valentin Vidic's avatar Valentin Vidic Committed by Stefan Bader

net: usb: sr9800: fix uninitialized local variable

BugLink: https://bugs.launchpad.net/bugs/1851549

commit 77b6d09f 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: default avatarValentin Vidic <vvidic@valentin-vidic.from.hr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 696c8cf9
...@@ -336,7 +336,7 @@ static void sr_set_multicast(struct net_device *net) ...@@ -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) static int sr_mdio_read(struct net_device *net, int phy_id, int loc)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
__le16 res; __le16 res = 0;
mutex_lock(&dev->phy_mutex); mutex_lock(&dev->phy_mutex);
sr_set_sw_mii(dev); sr_set_sw_mii(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment