netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] skbuff: use kfree_skb() instead of kfree()
@ 2011-07-20  7:23 Dan Carpenter
  2011-07-20  7:25 ` Dan Carpenter
  2011-07-20  8:51 ` [patch net-next-2.6 v2] skbuff: fix error handling in pskb_copy() Dan Carpenter
  0 siblings, 2 replies; 10+ messages in thread
From: Dan Carpenter @ 2011-07-20  7:23 UTC (permalink / raw)
  To: Shirley Ma
  Cc: David S. Miller, Eric Dumazet, Michał Mirosław,
	open list:NETWORKING [GENERAL], kernel-janitors

"n" was allocated with alloc_skb() so we should free it with
kfree_skb() instead of regular kfree().

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d220119..cc0c6f0 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -799,7 +799,7 @@ struct sk_buff *pskb_copy(struct sk_buff *skb, gfp_t gfp_mask)
 
 		if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
 			if (skb_copy_ubufs(skb, gfp_mask)) {
-				kfree(n);
+				kfree_skb(n);
 				goto out;
 			}
 			skb_shinfo(skb)->tx_flags &= ~SKBTX_DEV_ZEROCOPY;

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

end of thread, other threads:[~2011-07-21 21:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20  7:23 [patch] skbuff: use kfree_skb() instead of kfree() Dan Carpenter
2011-07-20  7:25 ` Dan Carpenter
2011-07-20  7:42   ` Eric Dumazet
2011-07-20  8:01     ` Dan Carpenter
2011-07-20  8:21       ` Eric Dumazet
2011-07-20  8:37         ` Julia Lawall
2011-07-20 21:03           ` Julie Sullivan
2011-07-20  8:51 ` [patch net-next-2.6 v2] skbuff: fix error handling in pskb_copy() Dan Carpenter
2011-07-20  8:59   ` Eric Dumazet
2011-07-21 21:48     ` 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).