mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-04-13 22:31:38 +01:00
lib: utils/irqchip: Fix context_map init in irqchip_plic_update_context_map()
The context_map[][] elements should be initialized with negative
value so that context_map does not point to anything for non-existent
PLIC contexts.
Fixes: 69448a0790 ("lib: utils/irqchip: plic: Provide a hartindex to context map")
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260213055342.3124872-4-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -24,6 +24,11 @@ static int irqchip_plic_update_context_map(const void *fdt, int nodeoff,
|
||||
u32 phandle, hwirq, hartid, hartindex;
|
||||
int i, err, count, cpu_offset, cpu_intc_offset;
|
||||
|
||||
for (i = 0; i < sbi_hart_count(); i++) {
|
||||
pd->context_map[i][PLIC_M_CONTEXT] = -1;
|
||||
pd->context_map[i][PLIC_S_CONTEXT] = -1;
|
||||
}
|
||||
|
||||
val = fdt_getprop(fdt, nodeoff, "interrupts-extended", &count);
|
||||
if (!val || count < sizeof(fdt32_t))
|
||||
return SBI_EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user