netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ipv4: icmp: use icmp_sk_exit()
@ 2019-02-22  1:57 Kefeng Wang
  2019-02-22  1:57 ` [PATCH 2/3] ipv6: icmp: use icmpv6_sk_exit() Kefeng Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kefeng Wang @ 2019-02-22  1:57 UTC (permalink / raw)
  To: davem, netdev; +Cc: Kefeng Wang

Simply use icmp_sk_exit() when inet_ctl_sock_create() fail in icmp_sk_init().

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 net/ipv4/icmp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 065997f414e6..364cfe5e414b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1245,9 +1245,7 @@ static int __net_init icmp_sk_init(struct net *net)
 	return 0;
 
 fail:
-	for_each_possible_cpu(i)
-		inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.icmp_sk, i));
-	free_percpu(net->ipv4.icmp_sk);
+	icmp_sk_exit(net);
 	return err;
 }
 
-- 
2.20.1


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

end of thread, other threads:[~2019-02-22 17:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22  1:57 [PATCH 1/3] ipv4: icmp: use icmp_sk_exit() Kefeng Wang
2019-02-22  1:57 ` [PATCH 2/3] ipv6: icmp: use icmpv6_sk_exit() Kefeng Wang
2019-02-22  1:58 ` [PATCH 3/3] ipv6: icmp: use percpu allocation Kefeng Wang
2019-02-22 17:11 ` [PATCH 1/3] ipv4: icmp: use icmp_sk_exit() Eric Dumazet
2019-02-22 17:16   ` Eric Dumazet

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