[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221104080347.21527-1-liupeibao@loongson.cn>
Date: Fri, 4 Nov 2022 16:03:47 +0800
From: Liu Peibao <liupeibao@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Marc Zyngier <maz@...nel.org>,
Jianmin Lv <lvjianmin@...ngson.cn>
Cc: Yinbo Zhu <zhuyinbo@...ngson.cn>,
Liu Peibao <liupeibao@...ngson.cn>, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init()
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@...ngson.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
Powered by blists - more mailing lists