netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] NET: pch, fix use after free
@ 2010-10-11  9:26 Jiri Slaby
  2010-10-11  9:26 ` [PATCH 2/3] ATM: iphase, remove sleep-inside-atomic Jiri Slaby
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jiri Slaby @ 2010-10-11  9:26 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, jirislaby, Masayuki Ohtake

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>
---
 drivers/net/pch_gbe/pch_gbe_main.c |    2 +-
 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 53c56cf..e44644f 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;
 	}
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-10-11 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11  9:26 [PATCH 1/3] NET: pch, fix use after free Jiri Slaby
2010-10-11  9:26 ` [PATCH 2/3] ATM: iphase, remove sleep-inside-atomic Jiri Slaby
2010-10-11 18:13   ` David Miller
2010-10-11  9:26 ` [PATCH 3/3] NET: wimax, fix use after free Jiri Slaby
2010-10-11 16:46   ` Inaky Perez-Gonzalez
2010-10-11 18:12     ` David Miller
2010-10-11  9:38 ` [PATCH 1/3] NET: pch, " Eric Dumazet
2010-10-11 18:13   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).