Skip to content

Commit 2e99b73

Browse files
bibo-maoMarc Zyngier
authored andcommitted
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: dd281e1 ("irqchip: Add Loongson Extended I/O interrupt controller support") Signed-off-by: Bibo Mao <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6eaae19 commit 2e99b73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-loongson-eiointc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static int eiointc_router_init(unsigned int cpu)
144144
int i, bit;
145145
uint32_t data;
146146
uint32_t node = cpu_to_eio_node(cpu);
147-
uint32_t index = eiointc_index(node);
147+
int index = eiointc_index(node);
148148

149149
if (index < 0) {
150150
pr_err("Error: invalid nodemap!\n");

0 commit comments

Comments
 (0)