summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kirjanov <kda@linux-powerpc.org>2019-07-30 15:13:57 +0200
committerDavid S. Miller <davem@davemloft.net>2019-08-01 18:18:27 -0400
commit224c04973db1125fcebefffd86115f99f50f8277 (patch)
tree8ec9b6aaa1832f9a8bcc57c93a2c95a8af6171aa
parent4da5f0018eef4c0de31675b670c80e82e13e99d1 (diff)
downloadlwn-224c04973db1125fcebefffd86115f99f50f8277.tar.gz
lwn-224c04973db1125fcebefffd86115f99f50f8277.zip
net: usb: pegasus: fix improper read if get_registers() fail
get_registers() may fail with -ENOMEM and in this case we can read a garbage from the status variable tmp. Reported-by: syzbot+3499a83b2d062ae409d4@syzkaller.appspotmail.com Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/pegasus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 6d25dea5ad4b..f7d117d80cfb 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -282,7 +282,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
static int read_eprom_word(pegasus_t *pegasus, __u8 index, __u16 *retdata)
{
int i;
- __u8 tmp;
+ __u8 tmp = 0;
__le16 retdatai;
int ret;