* [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init()
@ 2022-11-04 8:03 Liu Peibao
2022-11-04 9:48 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Liu Peibao @ 2022-11-04 8:03 UTC (permalink / raw)
To: Huacai Chen, Jiaxun Yang, Thomas Gleixner, Marc Zyngier,
Jianmin Lv
Cc: Yinbo Zhu, Liu Peibao, linux-mips, linux-kernel
For cores less than 4, eg, loongson2k1000 with 2 cores, the
of_property_match_string() may return with an error value,
which causes that liointc could not work. At least one isr
is what should be checked like previous commit <b2c4c3969fd7>
(irqchip/loongson-liointc: irqchip add 2.0 version) did.
Fixes: 0858ed035a85 ("irqchip/loongson-liointc: Add ACPI init support")
Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
---
drivers/irqchip/irq-loongson-liointc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index 0da8716f8f24..c4584e2f0ad3 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -207,10 +207,13 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
"reg-names", core_reg_names[i]);
if (index < 0)
- goto out_iounmap;
+ continue;
priv->core_isr[i] = of_iomap(node, index);
}
+
+ if (!priv->core_isr[0])
+ goto out_iounmap;
}
/* Setup IRQ domain */
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init()
2022-11-04 8:03 [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init() Liu Peibao
@ 2022-11-04 9:48 ` Sergei Shtylyov
2022-11-04 10:59 ` Liu Peibao
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2022-11-04 9:48 UTC (permalink / raw)
To: Liu Peibao, Huacai Chen, Jiaxun Yang, Thomas Gleixner,
Marc Zyngier, Jianmin Lv
Cc: Yinbo Zhu, linux-mips, linux-kernel
Hello!
On 11/4/22 11:03 AM, Liu Peibao wrote:
> For cores less than 4, eg, loongson2k1000 with 2 cores, the
> of_property_match_string() may return with an error value,
> which causes that liointc could not work. At least one isr
> is what should be checked like previous commit <b2c4c3969fd7>
> (irqchip/loongson-liointc: irqchip add 2.0 version) did.
It should look like this:
commit b2c4c3969fd7 ("irqchip/loongson-liointc: irqchip add 2.0 version")
> Fixes: 0858ed035a85 ("irqchip/loongson-liointc: Add ACPI init support")
> Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init()
2022-11-04 9:48 ` Sergei Shtylyov
@ 2022-11-04 10:59 ` Liu Peibao
0 siblings, 0 replies; 3+ messages in thread
From: Liu Peibao @ 2022-11-04 10:59 UTC (permalink / raw)
To: Sergei Shtylyov, Huacai Chen, Jiaxun Yang, Thomas Gleixner,
Marc Zyngier, Jianmin Lv
Cc: Yinbo Zhu, linux-mips, linux-kernel
On 11/4/22 5:48 PM, Sergei Shtylyov wrote:
> Hello!
>
> On 11/4/22 11:03 AM, Liu Peibao wrote:
>
>> For cores less than 4, eg, loongson2k1000 with 2 cores, the
>> of_property_match_string() may return with an error value,
>> which causes that liointc could not work. At least one isr
>> is what should be checked like previous commit <b2c4c3969fd7>
>> (irqchip/loongson-liointc: irqchip add 2.0 version) did.
>
> It should look like this:
>
> commit b2c4c3969fd7 ("irqchip/loongson-liointc: irqchip add 2.0 version")
>
Thanks, I will update the patch.
BR,
Peibao
>> Fixes: 0858ed035a85 ("irqchip/loongson-liointc: Add ACPI init support")
>> Signed-off-by: Liu Peibao <liupeibao@loongson.cn>
> [...]
>
> MBR, Sergey
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-04 10:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 8:03 [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init() Liu Peibao
2022-11-04 9:48 ` Sergei Shtylyov
2022-11-04 10:59 ` Liu Peibao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox