Skip to content

Commit

Permalink
net: usb: pegasus: fix improper read if get_registers() fail
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Aug 1, 2019
1 parent 4da5f00 commit 224c049
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 224c049

Please sign in to comment.