From: Jiri Slaby Date: Sun, 10 Oct 2010 23:26:56 +0000 (+0000) Subject: NET: pch, fix use after free X-Git-Tag: MMI-PSA29.97-13-9~21994^2~168 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=419c20465d6319274e7286f0966e2390540e6e0a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git NET: pch, fix use after free Stanse found that pch_gbe_xmit_frame uses skb after it is freed. Fix that. Signed-off-by: Jiri Slaby Cc: Masayuki Ohtake Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c index 53c56cf8aca2..e44644f169fd 100644 --- a/drivers/net/pch_gbe/pch_gbe_main.c +++ b/drivers/net/pch_gbe/pch_gbe_main.c @@ -1847,9 +1847,9 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) unsigned long flags; if (unlikely(skb->len > (adapter->hw.mac.max_frame_size - 4))) { - dev_kfree_skb_any(skb); pr_err("Transfer length Error: skb len: %d > max: %d\n", skb->len, adapter->hw.mac.max_frame_size); + dev_kfree_skb_any(skb); adapter->stats.tx_length_errors++; return NETDEV_TX_OK; }