Skip to content

Commit

Permalink
net: lan78xx: Bail out if lan78xx_get_endpoints fails
Browse files Browse the repository at this point in the history
We need to bail out if lan78xx_get_endpoints() fails, otherwise the
result is overwritten.

Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Raghuram Chary Jallipalli <raghuramchary.jallipalli@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stefan Wahren authored and David S. Miller committed Sep 6, 2018
1 parent 7848418 commit fa8cd98
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/usb/lan78xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
int i;

ret = lan78xx_get_endpoints(dev, intf);
if (ret) {
netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n",
ret);
return ret;
}

dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL);

Expand Down

0 comments on commit fa8cd98

Please sign in to comment.