[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H6k=xC-fDYnwsqSeoj7QPPn8RAcR+waQMa8yTs5J-XOSg@mail.gmail.com>
Date: Tue, 24 May 2022 18:48:25 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: WANG Xuerui <kernel@...0n.name>
Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
dan.carpenter@...cle.com, Jiaxun Yang <jiaxun.yang@...goat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
"open list:MIPS" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH] irqchip/loongson-liointc: Fix an error handling path in liointc_init()
Hi, Xuerui,
On Tue, May 24, 2022 at 1:41 PM WANG Xuerui <kernel@...0n.name> wrote:
>
> Hi Huacai,
>
> On 5/24/22 11:47, Huacai Chen wrote:
> > Hi, Christophe,
> >
> > On Tue, May 24, 2022 at 10:50 AM Huacai Chen <chenhuacai@...nel.org> wrote:
> >> Hi, Christophe,
> >>
> >> On Sun, May 22, 2022 at 9:44 PM Christophe JAILLET
> >> <christophe.jaillet@...adoo.fr> 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 <christophe.jaillet@...adoo.fr>
> >>> ---
> >>> 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.
> You could also "Reported-by" and/or "Suggested-by", to give proper
> credit. Mention of this mail thread (link to lore.kernel.org archive
> maybe) in the commit message is good too.
I think "Reported-by" is used for a bugfix patch, not suitable for the
original patch. And maybe "Suggested-by" is the best.
Huacai
> >
> > Huacai
> >>> priv->core_isr[i] = of_iomap(node, index);
> >>> }
> >>> --
> >>> 2.34.1
> >>>
Powered by blists - more mailing lists