Skip to content

Commit 017718d

Browse files
Wang Haigregkh
authored andcommitted
usbnet: fix error return code in usbnet_probe()
commit 6f7c886 upstream. Return error code if usb_maxpacket() returns 0 in usbnet_probe() Fixes: 397430b ("usbnet: sanity check for maxpacket") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Reviewed-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20211026124015.3025136-1-wanghai38@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 693ecbe commit 017718d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎drivers/net/usb/usbnet.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
17571757
dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
17581758
if (dev->maxpacket == 0) {
17591759
/* that is a broken device */
1760+
status = -ENODEV;
17601761
goto out4;
17611762
}
17621763

0 commit comments

Comments
 (0)