summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Hai <wanghai38@huawei.com>2021-10-26 20:40:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-02 17:38:11 +0100
commit65695c85607034b23d54dccbe7a9bdbf38b94cbf (patch)
tree7f5d34698dc1aa59c2660d7f627a10aeadfc3943
parentb9eba0a4a527e04d712f0e0401e5391ef124b33e (diff)
downloadlinux-stable-65695c85607034b23d54dccbe7a9bdbf38b94cbf.tar.gz
linux-stable-65695c85607034b23d54dccbe7a9bdbf38b94cbf.tar.bz2
linux-stable-65695c85607034b23d54dccbe7a9bdbf38b94cbf.zip
usbnet: fix error return code in usbnet_probe()
commit 6f7c88691191e6c52ef2543d6f1da8d360b27a24 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/usb/usbnet.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index b33709d8bd68..d98d50c895b8 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1732,6 +1732,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;
}