From: Kefeng Wang Date: Sat, 23 Feb 2019 07:28:26 +0000 (+0800) Subject: ipv4: icmp: use icmp_sk_exit() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e9128c14bf1ecf2d4afdd9aab2f5fe7277358233;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: David S. Miller --- 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; }