summaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2019-02-23 08:28:26 +0100
committerDavid S. Miller <davem@davemloft.net>2019-02-25 06:57:26 +0100
commite9128c14bf1ecf2d4afdd9aab2f5fe7277358233 (patch)
tree59024c4c347f7ed242ddd442053b58bbca630378 /net/ipv4/icmp.c
parentila: Fix uninitialised return value in ila_xlat_nl_cmd_flush (diff)
downloadlinux-e9128c14bf1ecf2d4afdd9aab2f5fe7277358233.tar.xz
linux-e9128c14bf1ecf2d4afdd9aab2f5fe7277358233.zip
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 '')
-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;
}