mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: dan.carpenter@oracle.com, Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	"open list:MIPS" <linux-mips@vger.kernel.org>
Subject: Re: [PATCH] irqchip/loongson-liointc: Fix an error handling path in liointc_init()
Date: Tue, 24 May 2022 07:36:59 +0200	[thread overview]
Message-ID: <1a1bd5ac-9094-4e8b-718a-ee70c2e89624@wanadoo.fr> (raw)
In-Reply-To: <CAAhV-H4Z4Ujif3UcSeSUMdT6SR0hVQnLCCzdGhg27mrtW4OvnQ@mail.gmail.com>

Le 24/05/2022 à 05:47, Huacai Chen a écrit :
> Hi, Christophe,
> 
> On Tue, May 24, 2022 at 10:50 AM Huacai Chen <chenhuacai@kernel.org> wrote:
>>
>> Hi, Christophe,
>>
>> On Sun, May 22, 2022 at 9:44 PM Christophe JAILLET
>> <christophe.jaillet@wanadoo.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@wanadoo.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.

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
>>>
> 


  reply	other threads:[~2022-05-24  5:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 13:44 Christophe JAILLET
2022-05-24  2:50 ` Huacai Chen
2022-05-24  3:47   ` Huacai Chen
2022-05-24  5:36     ` Christophe JAILLET [this message]
2022-05-24  5:41     ` WANG Xuerui
2022-05-24 10:48       ` Huacai Chen
2022-08-01 19:28 Christophe JAILLET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1a1bd5ac-9094-4e8b-718a-ee70c2e89624@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=chenhuacai@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®