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:
Anup Patel
2026-02-13 11:23:37 +05:30
committed by Anup Patel
parent 2110aab68f
commit 6d68f3bebd

View File

@@ -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;