Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3306948ioo; Tue, 24 May 2022 19:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK2kbJIROfx1PAYIykyhZXlr/MZBSJC6gQRASPtY48uqv80uUC7Ys0n8j6ooD5YAVow4A2 X-Received: by 2002:a17:90b:4a8e:b0:1e0:3839:2bcf with SMTP id lp14-20020a17090b4a8e00b001e038392bcfmr7877676pjb.58.1653446428485; Tue, 24 May 2022 19:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653446428; cv=none; d=google.com; s=arc-20160816; b=aUJ9OryL+e8lDsS57zdgsZ7Cz3sGpGmHxyvZNFwBGJNvx2Fbi43R8zLxZtIg91OcV8 E7a50A/GOGMY92r1ff1f5aQfo8+8p06TZd9xG7dXdU3b6/rkCKDzpTXtqhPgbNTU6LoG gkEkNwAVe1i+7sOrXObPrdA8EKwxRB3GDt8rqq9/CnT/DhKrXp6hsRk4JgM4mB89AB39 gvBaCkpe5DD/+bS5NVuvLaVvxHny1Yp4JnmoZeZxrJNombB7H+iQxt0BjtQpVM3pu7s6 kA71/Fap1LRMpcL2IVp5KiW4j0cF7wnTeFZXEo+jFaf4SZCy8xz1Cfg7FQ8RRWm9OL7n fkjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZjgbZj0fMR5vsj/r5ZT1EP5Sek/BcTZPFnxwTIhMlEQ=; b=0B+lfstIiLvJCmTR9PbXuyVkFMVTzB+a9+ETuW/W6KJuWFyJih50PJmDBnoZ7qEB+Z Tzsgj/tYqLzGOuN7MSzSNJZQMip25MeTYlwSU5RqI7Eov2670/7+gKntQX85T/igQ47H CsTeOsn2lDvMadu/DgGseEYNXXBtz90wH3TM3omNcTODJVlQMj+sEf0ccMLMhzo4Xrfs Dzi9WUE4l0ogBk0igLqEm4KTfm+k26DvzrjCytxiYOSOZup/hSruT/I/0hT/Ci3KZKzu OwBYYlvVbnrNJCSTrXggKGy23+W2gTmq9HvX6/v7y+n8IX+T2YxnHFOybcfmtAd6f+q5 z5SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qLORkRcp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a63e80c000000b003f9e159641fsi17198678pgh.663.2022.05.24.19.40.16; Tue, 24 May 2022 19:40:28 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qLORkRcp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234007AbiEXDri (ORCPT + 99 others); Mon, 23 May 2022 23:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231964AbiEXDre (ORCPT ); Mon, 23 May 2022 23:47:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 691636C0FB; Mon, 23 May 2022 20:47:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E75F16135A; Tue, 24 May 2022 03:47:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A376C34116; Tue, 24 May 2022 03:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653364050; bh=8tcF8bQShGWFWzNCMNh0zMWba2CPnkK1xQA6jsfKgwc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qLORkRcpbE/mbh+ysON84YFTBjvE4CAdwfvauETluzQN0DmkJovSQoyg3eTrQVETs k1RvQrazR8W/5DZSg5ER2PzL1nsIxCMm9+aEj0rU5J9ukvjSUpbvoaKbbxDr7c/hNW y739Kei6YXg2uvV4uHyF/+JRg26q9WKRalEinQWuSX30d2lgQnPsimRn+0ivSUmfy0 bW8jwJ2yndHBoFtKovyN3ZN7meicNoCQ/F+8sUwaN0TPxEpf1Ha1VvzsE3w7C6ZFJN h+ji7OdLUvXDrazOFO9CWDpVkqxb7Gtexn86Ls70R6ID8AM+0c5OhStubcRAo7Tfpe Bo+LGMkl2/BYg== Received: by mail-vs1-f43.google.com with SMTP id c26so16980670vsl.6; Mon, 23 May 2022 20:47:30 -0700 (PDT) X-Gm-Message-State: AOAM531UhgyBcdhhyv58SotF5LTE2QridM20dF8BpqYy/Nh8QiibZUrg 1CDliJqLHhFHXyiGkpMdgqfoh79WkGT9FlhmGVc= X-Received: by 2002:a67:e1c4:0:b0:335:cdc4:395f with SMTP id p4-20020a67e1c4000000b00335cdc4395fmr9637977vsl.71.1653364049315; Mon, 23 May 2022 20:47:29 -0700 (PDT) MIME-Version: 1.0 References: <1c4e81eda5f9651f581f1554629d334f1afda841.1653227039.git.christophe.jaillet@wanadoo.fr> In-Reply-To: From: Huacai Chen Date: Tue, 24 May 2022 11:47:23 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] irqchip/loongson-liointc: Fix an error handling path in liointc_init() To: Christophe JAILLET Cc: dan.carpenter@oracle.com, Jiaxun Yang , Thomas Gleixner , Marc Zyngier , LKML , kernel-janitors@vger.kernel.org, "open list:MIPS" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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. I've squash your patch to the original one and add a Co-developed-by:, not sure it is the best solution. Thanks. Huacai > > > > priv->core_isr[i] = of_iomap(node, index); > > } > > -- > > 2.34.1 > >