Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp451416ybt; Wed, 1 Jul 2020 02:26:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6hn0yTV3tZ2DOAFr/shHrKuTLZc+6vTDYhEfkcuDMhvxEMQhGpamjkskiK5SVPNPSHy8X X-Received: by 2002:a17:906:b2c8:: with SMTP id cf8mr22068906ejb.132.1593595573173; Wed, 01 Jul 2020 02:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593595573; cv=none; d=google.com; s=arc-20160816; b=OE+o8CAPHN6/Ie/VcIefe9z+nYWra0Z7G+5PyFRmdLoe5rpVjtBza8pApSWlz/VKfY aYsp86bVopcI/JyDEcyfrz2gMvEj61EAhtNX9xnt15Obn/qWyEQj4CCmxjks8mV4qUZ1 xbCTl/u2F3aWD+JKzUPXzY8SvSUBBWXc8gymMvxJv8U7X7sCy4n7WRGfzaWASlx3ffrW OibL4L2jIjBbHmIRMcLLoT7anvIbsbc9rW66HMxy2hJlY3VjQNE+4B+JKXLoCm7EIxcp TFh1Yy2ECPGCBrgw74FqS90oOJaLZ3Y7tc0f5y6D47Hynzu2xzfigg5DtWtfpboD9XPX onsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=SICLDLMwFyroZIGe5AbNXyX1A2M03wyqk26L5+/XYho=; b=mlkpn8CqGu8yNlVkcSq0ce0r0DoZkM586gJMbxj/p+FSsNZ149skpfnvhyK+2l0wB9 kaY3q0MtmXd/LvwMVjOOX3g6zpjTZJJTgs5gR5dVmhb4JdcyTYZjD7d4IQBF2sluTjYX ruMZsgNpZeFl9obpaE6/0Wx+XZ/bhT/fVVYfQKldmOQvgORFFzNadiwYvfV6yxkGOw/Y EZuUFKodc9y1EI0GVkJgCmtvASM8Y3UZzzkEq3lECi8M9bXoX5SPpd8R6BBaR9O1ys1c 6B5SkUzIxZLIBCx5pW5BwSgNCOa8nU+tZNpLt8YStJnhZvmoy1k1rlbTEPntrv91cunE GOdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si3527974edk.328.2020.07.01.02.25.50; Wed, 01 Jul 2020 02:26:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729156AbgGAJXj (ORCPT + 99 others); Wed, 1 Jul 2020 05:23:39 -0400 Received: from mail.loongson.cn ([114.242.206.163]:58090 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728776AbgGAJXj (ORCPT ); Wed, 1 Jul 2020 05:23:39 -0400 Received: from [10.130.0.52] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx72oSVvxebJ5NAA--.6442S3; Wed, 01 Jul 2020 17:23:30 +0800 (CST) Subject: Re: [PATCH v4 03/14] irqchip/csky-mpintc: Fix potential resource leaks To: Markus Elfring , Thomas Gleixner , Jason Cooper , Marc Zyngier , Guo Ren , linux-csky@vger.kernel.org References: <1593569786-11500-1-git-send-email-yangtiezhu@loongson.cn> <1593569786-11500-4-git-send-email-yangtiezhu@loongson.cn> <35eae701-e6b1-96af-9be4-0993330a17dc@web.de> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org From: Tiezhu Yang Message-ID: <6a468fb4-74b0-4bf3-49bc-cfc62d734e24@loongson.cn> Date: Wed, 1 Jul 2020 17:23:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <35eae701-e6b1-96af-9be4-0993330a17dc@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9Dx72oSVvxebJ5NAA--.6442S3 X-Coremail-Antispam: 1UD129KBjvdXoW7Jr1ftryDXF4DAr4DtF43KFg_yoW3trb_u3 45CrWkWa18JFn5AF4Svw4Yqa4vgr4UWw13tFW3Aws7J3s8X3yDZrWxA343ta47tFyjvFsx Ga17XrW2qrnFvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbI8YjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IE w4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r4j6F4UMc vjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vIY487MxkI ecxEwVAFwVW8uwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_ GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6Fyj6rWUJwCI42IY6I8E87Iv67AK xVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvj xU4nNVDUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2020 03:49 PM, Markus Elfring wrote: >> exception handling. By the way, do some coding-style cleanups > I propose to consider another bit of fine-tuning. > > > … >> +++ b/drivers/irqchip/irq-csky-mpintc.c > … >> @@ -270,12 +274,24 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent) >> >> #ifdef CONFIG_SMP >> ipi_irq = irq_create_mapping(root_domain, IPI_IRQ); >> - if (!ipi_irq) >> - return -EIO; >> + if (!ipi_irq) { >> + ret = -EIO; >> + goto err_domain_remove; > How do you think about to use the following source code variant > at this place? > > + irq_domain_remove(root_domain); > + ret = -EIO; > + goto err_iounmap; > > > Would you like to avoid the repetition of the check “#ifdef CONFIG_SMP”? OK, thank you, it looks good to me, I will do it in v5. > > Regards, > Markus