Skip to content

Commit

Permalink
irqchip/loongson-eiointc: Fix return value checking of eiointc_index
Browse files Browse the repository at this point in the history
[ Upstream commit 2e99b73 ]

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: dd281e1 ("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>
  • Loading branch information
Bibo Mao authored and Greg Kroah-Hartman committed Sep 13, 2023
1 parent 4d1566c commit 04f7ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-loongson-eiointc.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,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");
Expand Down

0 comments on commit 04f7ab3

Please sign in to comment.