Skip to content

Commit

Permalink
sgi-xp: fix a use after free
Browse files Browse the repository at this point in the history
Its illegal to dereference skb after dev_kfree_skb(skb)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Robin Holt <holt@sgi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jun 19, 2011
1 parent 658924d commit 44da29d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/misc/sgi-xp/xpnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
}

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

if (atomic_dec_return(&queued_msg->use_count) == 0) {
dev_kfree_skb(skb);
kfree(queued_msg);
}

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

return NETDEV_TX_OK;
}

Expand Down

0 comments on commit 44da29d

Please sign in to comment.