[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1416897631-4151-1-git-send-email-Yanjun.Zhu@windriver.com>
Date: Tue, 25 Nov 2014 14:40:31 +0800
From: Zhu Yanjun <zyjzyj2000@...il.com>
To: netdev@...r.kernel.org, zyjzyj2000@...il.com
Cc: Zhu Yanjun <Yanjun.Zhu@...driver.com>,
Hong Zhiguo <honkiko@...il.com>,
Octavian Purdila <opurdila@...acom.com>,
Pavel Emelyanov <xemul@...nvz.org>,
Cong Wang <cwang@...pensource.com>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH 1/1] ipv6: remove unnecessary condition judgement
The "init_net" condition judgement in function addrconf_exit_net is introduced
in commit 44a6bd29 [Create ipv6 devconf-s for namespaces] to avoid freeing
init_net. In commit c900a800 [ipv6: fix bad free of addrconf_init_net],
function addrconf_init_net will allocate memory for every net regardless of
init_net. In this case, it is unnecessary to make "init_net" condition judgement.
CC: Hong Zhiguo <honkiko@...il.com>
CC: Octavian Purdila <opurdila@...acom.com>
CC: Pavel Emelyanov <xemul@...nvz.org>
CC: Cong Wang <cwang@...pensource.com>
CC: David S. Miller <davem@...emloft.net>
Signed-off-by: Zhu Yanjun <Yanjun.Zhu@...driver.com>
---
net/ipv6/addrconf.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0169ccf..b8724fc 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -5336,10 +5336,8 @@ static void __net_exit addrconf_exit_net(struct net *net)
__addrconf_sysctl_unregister(net->ipv6.devconf_dflt);
__addrconf_sysctl_unregister(net->ipv6.devconf_all);
#endif
- if (!net_eq(net, &init_net)) {
- kfree(net->ipv6.devconf_dflt);
- kfree(net->ipv6.devconf_all);
- }
+ kfree(net->ipv6.devconf_dflt);
+ kfree(net->ipv6.devconf_all);
}
static struct pernet_operations addrconf_ops = {
--
1.9.1
--
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