Skip to content

Commit 6f7c886

Browse files
Wang Haikuba-moo
authored andcommitted
usbnet: fix error return code in usbnet_probe()
Return error code if usb_maxpacket() returns 0 in usbnet_probe() Fixes: 397430b ("usbnet: sanity check for maxpacket") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wang Hai <[email protected]> Reviewed-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent afe8ca1 commit 6f7c886

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/usb/usbnet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
17901790
dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
17911791
if (dev->maxpacket == 0) {
17921792
/* that is a broken device */
1793+
status = -ENODEV;
17931794
goto out4;
17941795
}
17951796

0 commit comments

Comments
 (0)