Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2525323ioo; Mon, 23 May 2022 22:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu2iOzPWtq2Pdq0ZJuS17bW1+daX9dBzLjS8kyrEYhdKqcBBpNCKS1wl0gY/q+2477bNJY X-Received: by 2002:a17:906:d159:b0:6fe:d886:aee8 with SMTP id br25-20020a170906d15900b006fed886aee8mr8487780ejb.766.1653371916337; Mon, 23 May 2022 22:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653371916; cv=none; d=google.com; s=arc-20160816; b=OLk3ZSzPMbTii6mOEnBqKFjPVUDuIZ9bI1JLazeCtpl0lzPpPL4x22LVEG9T6snBwV canD3+NJ7cF+kqUo/ksTIpWkt0+lkuECUxj7WR83U9+bMYy5vB1TyNwwsp/3qa6TtYh5 C9S3STDogOGr6xEZMnvUj6x4Y62ibIw+uqooBlw+Q9ODeinm1L7uMCJvqTyg5YNU/IXx vV4pSxwPJLlJcx4SL4FKGjvkqDzKA5CO+0f9ag60V/ioFBA/uVZcLaHu6ioQDvmU9mxV AzIVoN3CskAFVm8SB2gbgtTdGOrdR2mDGDBj8j+fdKrhpGK5mw5YOXogTCmezTT4N3mw 1GfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=t/jkoDK6kzqUvCyh4sNIZ33t1dPe5x5WEDYN9nq59CY=; b=ntw86huNGGLBIuFoXtKGrwUKiFvpr/svSuaqEUPY+n4si08uGumDtwxqYbdOYAVqCK LMbylEpZMv2rHL9aDxvBoTMSAtzdBkOXXjMi8mNUEd2Dk/4GIeIwGHCsuF1jU0eblLna KIrEAm8/frl8bhVlhZ8c20jgAW8LfJdoBdnUUpzFBFaegeP/rZTtyVra6GvkLI4iruuE wP7oVi/tAS2jFXXnGqfspkXRdFpMeDQjtpGutGXQu7w5YEZBgGqVegsBvTFFV8VCLu4G U4hL1YIGlHmXqwphmE7P6a7XNlVoy/v1VJv9ynnZArQBH7y8+flNoyGcIWE2b7A+7XU9 9Umw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a056402519200b0042af6d4bc31si17755739edd.313.2022.05.23.22.58.10; Mon, 23 May 2022 22:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234534AbiEXFhG (ORCPT + 99 others); Tue, 24 May 2022 01:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234516AbiEXFhF (ORCPT ); Tue, 24 May 2022 01:37:05 -0400 Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC1365D0A for ; Mon, 23 May 2022 22:37:03 -0700 (PDT) Received: from [192.168.1.18] ([90.11.191.102]) by smtp.orange.fr with ESMTPA id tNE3nOHw4P8AptNE4nN8eg; Tue, 24 May 2022 07:37:01 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 24 May 2022 07:37:01 +0200 X-ME-IP: 90.11.191.102 Message-ID: <1a1bd5ac-9094-4e8b-718a-ee70c2e89624@wanadoo.fr> Date: Tue, 24 May 2022 07:36:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] irqchip/loongson-liointc: Fix an error handling path in liointc_init() Content-Language: en-US To: Huacai Chen Cc: dan.carpenter@oracle.com, Jiaxun Yang , Thomas Gleixner , Marc Zyngier , LKML , kernel-janitors@vger.kernel.org, "open list:MIPS" References: <1c4e81eda5f9651f581f1554629d334f1afda841.1653227039.git.christophe.jaillet@wanadoo.fr> From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 24/05/2022 à 05:47, Huacai Chen a écrit : > Hi, Christophe, > > On Tue, May 24, 2022 at 10:50 AM Huacai Chen wrote: >> >> Hi, Christophe, >> >> On Sun, May 22, 2022 at 9:44 PM Christophe JAILLET >> wrote: >>> >>> If a of_property_match_string() call fails, we still need to release some >>> resources. >>> Add the corresponding goto instead of a direct return. >> Your patch is correct, but 807e93d0ecbb hasn't been upstream, I don't >> know how to handle it. >> >> Huacai >>> >>> Fixes: 807e93d0ecbb ("irqchip/loongson-liointc: Add ACPI init support") >>> Signed-off-by: Christophe JAILLET >>> --- >>> drivers/irqchip/irq-loongson-liointc.c | 6 ++++-- >>> 1 file changed, 4 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c >>> index ff3cb5b05710..2227b702a81d 100644 >>> --- a/drivers/irqchip/irq-loongson-liointc.c >>> +++ b/drivers/irqchip/irq-loongson-liointc.c >>> @@ -185,8 +185,10 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, >>> int index = of_property_match_string(node, >>> "reg-names", core_reg_names[i]); >>> >>> - if (index < 0) >>> - return -EINVAL; >>> + if (index < 0) { >>> + err = -EINVAL; >>> + goto out_iounmap; >>> + } > Just goto out_iounmap is OK, because it returns -EINVAL at last. Yes, agreed. > I've squash your patch to the original one and add a Co-developed-by:, > not sure it is the best solution. Thanks. Squashing in the original patch is fine for me. It is what is usually done in such cases. The Co-developed-by: is maybe a bit to much. I've just fixed a bug that can't happen (IMHO) in real life. I'll let you decide what is more relevant. With or without the tag is fine for me as well. CJ > > Huacai >>> >>> priv->core_isr[i] = of_iomap(node, index); >>> } >>> -- >>> 2.34.1 >>> >