aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hp100.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-06-19 08:43:33 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-19 19:28:02 -0400
commit658924dc9ae2ca8e3c46f36306f5dbd501cf4688 (patch)
treea10de7dfe5bd02f963455559868d4574cb08724c /drivers/net/hp100.c
parent00ce2d5614a67521241d024c6e50afe3bd3df049 (diff)
hp100: fix an skb->len race
As soon as skb is given to hardware and spinlock released, TX completion can free skb under us. Therefore, we should update netdev stats before spinlock release. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hp100.c')
-rw-r--r--drivers/net/hp100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 8e10d2f6a5ad..c3ecb118c1df 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -1580,12 +1580,12 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb,
1580 hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */ 1580 hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */
1581 1581
1582 lp->txrcommit++; 1582 lp->txrcommit++;
1583 spin_unlock_irqrestore(&lp->lock, flags);
1584 1583
1585 /* Update statistics */
1586 dev->stats.tx_packets++; 1584 dev->stats.tx_packets++;
1587 dev->stats.tx_bytes += skb->len; 1585 dev->stats.tx_bytes += skb->len;
1588 1586
1587 spin_unlock_irqrestore(&lp->lock, flags);
1588
1589 return NETDEV_TX_OK; 1589 return NETDEV_TX_OK;
1590 1590
1591drop: 1591drop: