]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
irqchip/irq-riscv-imsic-early: Fix fwnode leak on state setup failure
authorHaoxiang Li <haoxiang_li2024@163.com>
Tue, 23 Jun 2026 07:37:44 +0000 (15:37 +0800)
committerThomas Gleixner <tglx@kernel.org>
Tue, 30 Jun 2026 16:49:48 +0000 (18:49 +0200)
commit1358126fbed104e5657955d3ba029b283687ba02
tree05f0f07efa1648ec72d0b4ab6292002023c0caf0
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482
irqchip/irq-riscv-imsic-early: Fix fwnode leak on state setup failure

imsic_early_acpi_init() allocates a firmware node before setting up the
IMSIC state. If imsic_setup_state() fails, the function returns without
freeing the allocated fwnode.

Free the fwnode and clear the global pointer on this error path, matching
the cleanup already done when imsic_early_probe() fails.

[ tglx: Use a common cleanup path instead of copying code around ]

Fixes: fbe826b1c106 ("irqchip/riscv-imsic: Add ACPI support")
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260623073744.2009137-1-haoxiang_li2024@163.com
drivers/irqchip/irq-riscv-imsic-early.c