Skip to content

Commit 63e4b45

Browse files
httpstormkuba-moo
authored andcommitted
ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback
When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, which reduces the usable size by 2 bytes. Otherwise we have 1512 bytes usable instead of 1514, and if we receive more than 1512 bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, after which the driver malfunctiones and all communication stops. Resolves ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 Fixes: f33d9e2 ("usbnet: ipheth: fix connectivity with iOS 14") Signed-off-by: Georgi Valkov <[email protected]> Tested-by: Jan Kiszka <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/24851bd2769434a5fc24730dce8e8a984c5a4505.1643699778.git.jan.kiszka@siemens.com/ Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 479f554 commit 63e4b45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/usb/ipheth.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
121121
if (tx_buf == NULL)
122122
goto free_rx_urb;
123123

124-
rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
124+
rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
125125
GFP_KERNEL, &rx_urb->transfer_dma);
126126
if (rx_buf == NULL)
127127
goto free_tx_buf;
@@ -146,7 +146,7 @@ static int ipheth_alloc_urbs(struct ipheth_device *iphone)
146146

147147
static void ipheth_free_urbs(struct ipheth_device *iphone)
148148
{
149-
usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
149+
usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN, iphone->rx_buf,
150150
iphone->rx_urb->transfer_dma);
151151
usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
152152
iphone->tx_urb->transfer_dma);
@@ -317,7 +317,7 @@ static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
317317

318318
usb_fill_bulk_urb(dev->rx_urb, udev,
319319
usb_rcvbulkpipe(udev, dev->bulk_in),
320-
dev->rx_buf, IPHETH_BUF_SIZE,
320+
dev->rx_buf, IPHETH_BUF_SIZE + IPHETH_IP_ALIGN,
321321
ipheth_rcvbulk_callback,
322322
dev);
323323
dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;

0 commit comments

Comments
 (0)