aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/usb/usbnet.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 17b6a62d206e..c0f64392627c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1068,12 +1068,15 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1068 * NOTE: strictly conforming cdc-ether devices should expect 1068 * NOTE: strictly conforming cdc-ether devices should expect
1069 * the ZLP here, but ignore the one-byte packet. 1069 * the ZLP here, but ignore the one-byte packet.
1070 */ 1070 */
1071 if (!(info->flags & FLAG_SEND_ZLP) && (length % dev->maxpacket) == 0) { 1071 if (length % dev->maxpacket == 0) {
1072 urb->transfer_buffer_length++; 1072 if (!(info->flags & FLAG_SEND_ZLP)) {
1073 if (skb_tailroom(skb)) { 1073 urb->transfer_buffer_length++;
1074 skb->data[skb->len] = 0; 1074 if (skb_tailroom(skb)) {
1075 __skb_put(skb, 1); 1075 skb->data[skb->len] = 0;
1076 } 1076 __skb_put(skb, 1);
1077 }
1078 } else
1079 urb->transfer_flags |= URB_ZERO_PACKET;
1077 } 1080 }
1078 1081
1079 spin_lock_irqsave(&dev->txq.lock, flags); 1082 spin_lock_irqsave(&dev->txq.lock, flags);