diff options
author | Bibo Mao | 2023-08-11 17:58:04 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-09-13 09:42:29 +0200 |
commit | 8ee6d04ef24bf566e72d3ab575a81d41910171a5 (patch) | |
tree | cd37365db1fbbf94dc136e6170a3bf7fbde7da36 | |
parent | 14e37e08b4e12d00d500ceb14475baa43cd52021 (diff) |
irqchip/loongson-eiointc: Fix return value checking of eiointc_index
[ Upstream commit 2e99b73afde18853754c5fae8e8d1a66fe5e3f64 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/irqchip/irq-loongson-eiointc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index ac04aeaa2d30..3d99b8bdd8ef 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -145,7 +145,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"); |