From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A29A8C43381 for ; Sat, 23 Feb 2019 07:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DE2A20661 for ; Sat, 23 Feb 2019 07:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726065AbfBWHPk (ORCPT ); Sat, 23 Feb 2019 02:15:40 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:4263 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725898AbfBWHPj (ORCPT ); Sat, 23 Feb 2019 02:15:39 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id F0D0C5D659DA5517E77E; Sat, 23 Feb 2019 15:15:37 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.408.0; Sat, 23 Feb 2019 15:15:29 +0800 From: Kefeng Wang To: , , CC: Kefeng Wang Subject: [PATCH net-next v2 1/3] ipv4: icmp: use icmp_sk_exit() Date: Sat, 23 Feb 2019 15:28:26 +0800 Message-ID: <20190223072828.159975-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190223072828.159975-1-wangkefeng.wang@huawei.com> References: <20190223072828.159975-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Simply use icmp_sk_exit() when inet_ctl_sock_create() fail in icmp_sk_init(). Signed-off-by: Kefeng Wang --- 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