[PATCH] irqchip/riscv-imsic: Fix 'imsic' dereferenced before NULL check
Thomas Gleixner
tglx at linutronix.de
Sat Aug 2 15:19:24 PDT 2025
On Sat, Aug 02 2025 at 01:24, Kuan-Wei Chiu wrote:
> Smatch reported a warning in imsic_irqdomain_init():
>
> drivers/irqchip/irq-riscv-imsic-platform.c:317 imsic_irqdomain_init() warn: variable dereferenced before check 'imsic' (see line 311)
>
> The variable imsic was dereferenced before being checked for NULL.
> To fix this, move the initialization of struct irq_domain_info after
> the NULL check to avoid accessing imsic prematurely.
It's fixed already w/o moving the struct into the middle of the code:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=irq/urgent
But thanks a lot for caring!
Thanks,
tglx
More information about the linux-riscv
mailing list