summaryrefslogtreecommitdiff
path: root/drivers/irqchip
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2023-08-11 12:58:04 +0300
committerMarc Zyngier <maz@kernel.org>2023-08-21 19:39:21 +0300
commit2e99b73afde18853754c5fae8e8d1a66fe5e3f64 (patch)
treeeffde3eb6241e8df3024957d5feb632bb5b5e41a /drivers/irqchip
parent6eaae198076080886b9e7d57f4ae06fa782f90ef (diff)
downloadlinux-2e99b73afde18853754c5fae8e8d1a66fe5e3f64.tar.xz
irqchip/loongson-eiointc: Fix return value checking of eiointc_index
Return value of function eiointc_index is int, however it is converted into uint32_t and then compared smaller than zero, this will cause logic problem. Fixes: dd281e1a1a93 ("irqchip: Add Loongson Extended I/O interrupt controller support") Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230811095805.2974722-2-maobibo@loongson.cn
Diffstat (limited to 'drivers/irqchip')
-rw-r--r--drivers/irqchip/irq-loongson-eiointc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
index 92d8aa28bdf5..1623cd779175 100644
--- a/drivers/irqchip/irq-loongson-eiointc.c
+++ b/drivers/irqchip/irq-loongson-eiointc.c
@@ -144,7 +144,7 @@ static int eiointc_router_init(unsigned int cpu)
int i, bit;
uint32_t data;
uint32_t node = cpu_to_eio_node(cpu);
- uint32_t index = eiointc_index(node);
+ int index = eiointc_index(node);
if (index < 0) {
pr_err("Error: invalid nodemap!\n");