diff options
author | Wang Hai <wanghai38@huawei.com> | 2021-10-26 20:40:15 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-27 12:06:15 -0700 |
commit | 6f7c88691191e6c52ef2543d6f1da8d360b27a24 (patch) | |
tree | 9735141f2bccfb85e0cc17735a5a702d9c4bf6fb /drivers | |
parent | afe8ca110cf4c99dee7b31473eacb56b72944df4 (diff) |
usbnet: fix error return code in usbnet_probe()
Return error code if usb_maxpacket() returns 0 in usbnet_probe()
Fixes: 397430b50a36 ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/usbnet.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 80432ee0ce69..a33d7fb82a00 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1790,6 +1790,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); if (dev->maxpacket == 0) { /* that is a broken device */ + status = -ENODEV; goto out4; } |