[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <45B97763.8000305@ncos.nec.co.jp>
Date: Thu, 25 Jan 2007 19:37:07 -0800
From: Masayuki Nakagawa <nakagawa.msy@...s.nec.co.jp>
To: davem@...emloft.net, yoshfuji@...ux-ipv6.org,
herbert@...dor.apana.org.au
Cc: nakagawa.msy@...s.nec.co.jp, mhuth@...sta.com,
netdev@...r.kernel.org
Subject: [PATCH] TCP: Replace __kfree_skb() with kfree_skb()
This patch simply replaces __kfree_skb() in exit path with kfree_skb().
In tcp_rcv_state_process(), generally skbs should be destroyed only when
the ref count is zero.
That is the way things are supposed to be done in the kernel.
This change might reveals a memory leak of skb.
If it happens, it would be because someone doesn't deal with the skb properly.
Signed-off-by: Masayuki Nakagawa <nakagawa.msy@...s.nec.co.jp>
--- linux-2.6/net/ipv4/tcp_input.c.orig 2007-01-25 07:04:35.000000000 -0800
+++ linux-2.6/net/ipv4/tcp_input.c 2007-01-25 07:05:05.000000000 -0800
@@ -4423,8 +4423,6 @@ int tcp_rcv_state_process(struct sock *s
* in the interest of security over speed unless
* it's still in use.
*/
- kfree_skb(skb);
- return 0;
}
goto discard;
@@ -4634,7 +4632,7 @@ int tcp_rcv_state_process(struct sock *s
if (!queued) {
discard:
- __kfree_skb(skb);
+ kfree_skb(skb);
}
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists