Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: lan78xx: Bail out if lan78xx_get_endpoints fails

We need to bail out if lan78xx_get_endpoints() fails, otherwise the
result is overwritten.

Fixes: 55d7de9de6c3 ("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>

authored by

Stefan Wahren and committed by
David S. Miller
fa8cd98c 7848418e

+5
+5
drivers/net/usb/lan78xx.c
··· 2952 2952 int i; 2953 2953 2954 2954 ret = lan78xx_get_endpoints(dev, intf); 2955 + if (ret) { 2956 + netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n", 2957 + ret); 2958 + return ret; 2959 + } 2955 2960 2956 2961 dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL); 2957 2962