aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby2010-10-10 23:26:56 +0000
committerDavid S. Miller2010-10-11 11:13:59 -0700
commit419c20465d6319274e7286f0966e2390540e6e0a (patch)
treec4fca8f173fdd69b07a08455b34e0c01aacbe949
parent34d101dd6204bd100fc2e6f7b5f9a10f959ce2c9 (diff)
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 <jslaby@suse.cz> Cc: Masayuki Ohtake <masa-korg@dsn.okisemi.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/pch_gbe/pch_gbe_main.c2
1 files changed, 1 insertions, 1 deletions
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;
}