summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sbi/sbi_irqchip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sbi/sbi_irqchip.c b/lib/sbi/sbi_irqchip.c
index b490a3ad..1664bd2d 100644
--- a/lib/sbi/sbi_irqchip.c
+++ b/lib/sbi/sbi_irqchip.c
@@ -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);