mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-08 18:21:29 +01:00
lib: sbi_irqchip: error handling in sbi_irqchip_raw_handler_default()
sbi_irqchip_find_handler() may return NULL. Check the return value before dereferencing. Addresses-Coverity-ID: 1677408 Dereference null return value Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260820134431.167336-1-heinrich.schuchardt@canonical.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
7384968e02
commit
bf459f85bf
@@ -185,6 +185,9 @@ int sbi_irqchip_raw_handler_default(struct sbi_irqchip_device *chip, u32 hwirq)
|
||||
return SBI_EINVAL;
|
||||
|
||||
h = sbi_irqchip_find_handler(chip, hwirq);
|
||||
if (!h)
|
||||
return SBI_EINVAL;
|
||||
|
||||
if (h->callback)
|
||||
rc = h->callback(hwirq, h->priv);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user