From: zhuyj Date: Wed, 26 Nov 2014 02:25:58 +0000 (+0800) Subject: ipv6: Remove unnecessary test X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73cf0e923d685a6a1b7754c7d29cc14944f271d9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ipv6: Remove unnecessary test The "init_net" test 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" test. CC: Hong Zhiguo CC: Octavian Purdila CC: Pavel Emelyanov CC: Cong Wang Suggested-by: David S. Miller Signed-off-by: Zhu Yanjun Signed-off-by: David S. Miller --- diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 9eac3a7fefa3..f7c8bbeb27b7 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -5380,10 +5380,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 = {