Skip to content

Commit

Permalink
net: l2tp_eth: fix l2tp_eth_dev_xmit race
Browse files Browse the repository at this point in the history
Its illegal to dereference skb after giving it to l2tp_xmit_skb()
as it might be already freed/reused.

Signed-off-by: Eric Dumazet <[email protected]>
Cc: James Chapman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jun 25, 2012
1 parent 044ca2a commit aa214de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/l2tp/l2tp_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
struct l2tp_eth *priv = netdev_priv(dev);
struct l2tp_session *session = priv->session;

l2tp_xmit_skb(session, skb, session->hdr_len);

dev->stats.tx_bytes += skb->len;
dev->stats.tx_packets++;

return 0;
l2tp_xmit_skb(session, skb, session->hdr_len);

return NETDEV_TX_OK;
}

static struct net_device_ops l2tp_eth_netdev_ops = {
Expand Down

0 comments on commit aa214de

Please sign in to comment.