[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211026124015.3025136-1-wanghai38@huawei.com>
Date: Tue, 26 Oct 2021 20:40:15 +0800
From: Wang Hai <wanghai38@...wei.com>
To: <oneukum@...e.com>, <davem@...emloft.net>, <kuba@...nel.org>,
<johan@...nel.org>
CC: <netdev@...r.kernel.org>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH net v2] 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@...wei.com>
Signed-off-by: Wang Hai <wanghai38@...wei.com>
---
v1->v2: change '-EINVAL' to '-ENODEV'
drivers/net/usb/usbnet.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.25.1
Powered by blists - more mailing lists