Commit d530fb24 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] fix lance using skb_padto

parent bcef46b8
......@@ -899,8 +899,14 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* The old LANCE chips doesn't automatically pad buffers to min. size. */
if (chip_table[lp->chip_version].flags & LANCE_MUST_PAD) {
lp->tx_ring[entry].length =
-(ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN);
if (skb->len < ETH_ZLEN) {
skb = skb_padto(skb, ETH_ZLEN);
if (skb == NULL)
goto out;
lp->tx_ring[entry].length = -ETH_ZLEN;
}
else
lp->tx_ring[entry].length = -skb->len;
} else
lp->tx_ring[entry].length = -skb->len;
......@@ -933,6 +939,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
if ((lp->cur_tx - lp->dirty_tx) >= TX_RING_SIZE)
netif_stop_queue(dev);
out:
spin_unlock_irqrestore(&lp->devlock, flags);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment