summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/usb/dm9601.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index a6763860147..ac200b0f6a9 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -489,6 +489,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
b3..n: packet data
*/
+ len = skb->len;
+
if (skb_headroom(skb) < DM_TX_OVERHEAD) {
struct sk_buff *skb2;
@@ -501,10 +503,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
__skb_push(skb, DM_TX_OVERHEAD);
- len = skb->len;
/* usbnet adds padding if length is a multiple of packet size
if so, adjust length value in header */
- if ((len % dev->maxpacket) == 0)
+ if ((skb->len % dev->maxpacket) == 0)
len++;
skb->data[0] = len;