]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: aspeed: Fix IRQ domain leak on platform_get_irq() failure
authorFelix Gu <ustc.gu@gmail.com>
Mon, 23 Mar 2026 17:57:59 +0000 (01:57 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Sat, 4 Apr 2026 10:32:55 +0000 (16:02 +0530)
commitc54d5f5b33990f2649c20f35407f340bcadb8a53
tree76e8fd9afe6fa1844523235b726727a2356945f1
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
PCI: aspeed: Fix IRQ domain leak on platform_get_irq() failure

The aspeed_pcie_probe() function calls aspeed_pcie_init_irq_domain()
which allocates pcie->intx_domain and initializes MSI. However, if
platform_get_irq() fails afterwards, the cleanup action was not yet
registered via devm_add_action_or_reset(), causing the IRQ domain
resources to leak.

Fix this by registering the devm cleanup action immediately after
aspeed_pcie_init_irq_domain() succeeds, before calling
platform_get_irq(). This ensures proper cleanup on any subsequent
failure.

Fixes: 9aa0cb68fcc1 ("PCI: aspeed: Add ASPEED PCIe RC driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Jacky Chou <jacky_chou@aspeedtech.com>
Link: https://patch.msgid.link/20260324-aspeed-v1-1-354181624c00@gmail.com
drivers/pci/controller/pcie-aspeed.c