diff options
| author | Heinrich Schuchardt <[email protected]> | 2026-08-20 15:44:30 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2026-09-04 13:55:01 +0530 |
| commit | bf459f85bf75d86cbf028e136067ce96aefde221 (patch) | |
| tree | ded26a57c654598ef952495ffc7e94cf9b1a267a | |
| parent | 7384968e020f3bf9d524a00c6dc5638f3383aa92 (diff) | |
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 <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_irqchip.c | 3 |
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); |
