netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7 net-2.6.25] [IPV4]: Fix memory leak on error path during FIB initialization.
@ 2008-01-25 13:51 Denis V. Lunev
  2008-01-25 13:51 ` [PATCH 2/7 net-2.6.25] [IPV4]: Small style cleanup of the error path in rtm_to_ifaddr Denis V. Lunev
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Denis V. Lunev @ 2008-01-25 13:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, devel, containers, Denis V. Lunev

net->ipv4.fib_table_hash is not freed when fib4_rules_init failed. The problem
has been introduced by the following commit.
commit c8050bf6d84785a7edd2e81591e8f833231477e8
Author: Denis V. Lunev <den@openvz.org>
Date:   Thu Jan 10 03:28:24 2008 -0800

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 net/ipv4/fib_frontend.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index d282618..d0507f4 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -975,6 +975,7 @@ static struct notifier_block fib_netdev_notifier = {
 
 static int __net_init ip_fib_net_init(struct net *net)
 {
+	int err;
 	unsigned int i;
 
 	net->ipv4.fib_table_hash = kzalloc(
@@ -985,7 +986,14 @@ static int __net_init ip_fib_net_init(struct net *net)
 	for (i = 0; i < FIB_TABLE_HASHSZ; i++)
 		INIT_HLIST_HEAD(&net->ipv4.fib_table_hash[i]);
 
-	return fib4_rules_init(net);
+	err = fib4_rules_init(net);
+	if (err < 0)
+		goto fail;
+	return 0;
+
+fail:
+	kfree(net->ipv4.fib_table_hash);
+	return err;
 }
 
 static void __net_exit ip_fib_net_exit(struct net *net)
-- 
1.5.3.rc5


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

end of thread, other threads:[~2008-01-25 16:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-25 13:51 [PATCH 1/7 net-2.6.25] [IPV4]: Fix memory leak on error path during FIB initialization Denis V. Lunev
2008-01-25 13:51 ` [PATCH 2/7 net-2.6.25] [IPV4]: Small style cleanup of the error path in rtm_to_ifaddr Denis V. Lunev
2008-01-25 13:51 ` [PATCH 3/7 net-2.6.25] [IPV4]: Prohibit assignment of 0.0.0.0 as interface address Denis V. Lunev
2008-01-25 14:01   ` Daniel Lezcano
2008-01-25 14:13     ` Denis V. Lunev
2008-01-25 14:37       ` Daniel Lezcano
2008-01-25 14:48       ` Daniel Lezcano
2008-01-25 15:12         ` Denis V. Lunev
2008-01-25 15:12           ` Daniel Lezcano
2008-01-25 16:34   ` Stephen Hemminger
2008-01-25 13:52 ` [PATCH 4/7 net-2.6.25] [NETNS]: Process interface address manipulation routines in the namespace Denis V. Lunev
2008-01-25 13:52 ` [PATCH 5/7 net-2.6.25] [IPV4]: fib_sync_down rework Denis V. Lunev
2008-01-25 13:52 ` [PATCH 6/7 net-2.6.25] [NETNS]: Add a namespace mark to fib_info Denis V. Lunev
2008-01-25 13:52 ` [PATCH 7/7 net-2.6.25] [NETNS]: Lookup in FIB semantic hashes taking into account the namespace Denis V. Lunev

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).