diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-28 19:43:58 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-28 19:43:58 +0200 |
commit | 7df621a3eea6761bc83e641aaca6963210c7290d (patch) | |
tree | 65ab9d0d1894153ceefcb6b5a1c25b8d17c466fd /drivers/net/usb | |
parent | net: virtio: use eth_hw_addr_set() (diff) | |
parent | Merge tag 'net-5.15-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff) | |
download | linux-7df621a3eea6761bc83e641aaca6963210c7290d.tar.xz linux-7df621a3eea6761bc83e641aaca6963210c7290d.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
include/net/sock.h
7b50ecfcc6cd ("net: Rename ->stream_memory_read to ->sock_is_readable")
4c1e34c0dbff ("vsock: Enable y2038 safe timeval for timeout")
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
0daa55d033b0 ("octeontx2-af: cn10k: debugfs for dumping LMTST map table")
e77bcdd1f639 ("octeontx2-af: Display all enabled PF VF rsrc_alloc entries.")
Adjacent code addition in both cases, keep both.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/lan78xx.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 03319fdb5235..f20376c1ef3f 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -4122,6 +4122,12 @@ static int lan78xx_probe(struct usb_interface *intf, dev->maxpacket = usb_maxpacket(dev->udev, dev->pipe_out, 1); + /* Reject broken descriptors. */ + if (dev->maxpacket == 0) { + ret = -ENODEV; + goto out4; + } + /* driver requires remote-wakeup capability during autosuspend. */ intf->needs_remote_wakeup = 1; diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 350bae673ed4..9a6450f796dc 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1792,6 +1792,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; } |