summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-11-30 23:12:27 +0100
committerDavid S. Miller <davem@davemloft.net>2011-11-30 23:12:27 +0100
commit449fa023bca5b53bd924d91a27ffd34807fdeb80 (patch)
tree196813959c3c790a8eb2e06281e78fd316930b63
parentbnx2: Support for byte queue limits (diff)
downloadlinux-449fa023bca5b53bd924d91a27ffd34807fdeb80.tar.xz
linux-449fa023bca5b53bd924d91a27ffd34807fdeb80.zip
sfc: fix race in efx_enqueue_skb_tso()
As soon as skb is pushed to hardware, it can be completed and freed, so we should not dereference skb anymore. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/tx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index ab4c63570023..e0e00b3d6a82 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -1173,11 +1173,11 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue,
goto mem_err;
}
+ netdev_tx_sent_queue(tx_queue->core_txq, skb->len);
+
/* Pass off to hardware */
efx_nic_push_buffers(tx_queue);
- netdev_tx_sent_queue(tx_queue->core_txq, skb->len);
-
tx_queue->tso_bursts++;
return NETDEV_TX_OK;