]> git.ipfire.org Git - thirdparty/linux.git/commit
irqchip: Plug a OF node reference leak in platform_irqchip_probe()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Sun, 15 Dec 2024 03:39:45 +0000 (12:39 +0900)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 15 Jan 2025 09:38:43 +0000 (10:38 +0100)
commit9322d1915f9d976ee48c09d800fbd5169bc2ddcc
treed7466dec4b8fa95b735f55f4ca939d878d5e3808
parent3a748d483d80f066ca4b26abe45cdc0c367d13e9
irqchip: Plug a OF node reference leak in platform_irqchip_probe()

platform_irqchip_probe() leaks a OF node when irq_init_cb() fails. Fix it
by declaring par_np with the __free(device_node) cleanup construct.

This bug was found by an experimental static analysis tool that I am
developing.

Fixes: f8410e626569 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20241215033945.3414223-1-joe@pf.is.s.u-tokyo.ac.jp
drivers/irqchip/irqchip.c