usbnet: Zero padding byte if there is tail room in skb
PATCH 1/1 usbnet: Zero padding byte if there is tail room in skb
Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero padding byte if there is tail room in skb.
Signed-of-by Peter Korsgaard <[email protected]>
Acked-by David Brownell <[email protected]>
--- drivers/net/usb/usbnet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/usb/usbnet.c +6 -3
@@ -953,11 +953,14 @@/* don't assume the hardware handles USB_ZERO_PACKET * NOTE: strictly conforming cdc-ether devices should expect * the ZLP here, but ignore the one-byte packet. -* -* FIXME zero that byte, if it doesn't require a new skb. */ -if ((length % dev->maxpacket) ==0 ) +if ((length % dev->maxpacket) ==0 ) { urb->transfer_buffer_length++; +if (skb_tailroom (skb)) { + skb->data[skb->len] =0 ; +__skb_put (skb,1 ); + } + }spin_lock_irqsave (&dev->txq.lock, flags);
Signature · 1 line
Bye, Peter Korsgaard
Jeff Garzik
AppliedQuoted 9 lines · Peter Korsgaard
Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero padding byte if there is tail room in skb.
Signed-of-by Peter Korsgaard <[email protected]>Acked-by David Brownell <[email protected]>--- drivers/net/usb/usbnet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
applied