summaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2019-02-23 15:28:26 +0800
committerDavid S. Miller <davem@davemloft.net>2019-02-24 21:57:26 -0800
commite9128c14bf1ecf2d4afdd9aab2f5fe7277358233 (patch)
tree59024c4c347f7ed242ddd442053b58bbca630378 /net/ipv4/icmp.c
parent4ef595cbb3f871620083dcface7a7fb8f2152607 (diff)
downloadlinux-e9128c14bf1ecf2d4afdd9aab2f5fe7277358233.tar.bz2
ipv4: icmp: use icmp_sk_exit()
Simply use icmp_sk_exit() when inet_ctl_sock_create() fail in icmp_sk_init(). Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r--net/ipv4/icmp.c4
1 files changed, 1 insertions, 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;
}