[PATCH] PCI: rockchip-dw: Fix potential stale INTx handler on probe failure

Guangshuo Li liguangshuo at mail.sdu.edu.cn
Tue Dec 1 04:29:50 PST 2026


If host initialization fails, probe cleanup releases the Rockchip
controller but leaves the chained INTx handler and its domain
registered. Both retain pointers to the freed controller.

Clear the chained handler and remove the unused domain before returning
the host initialization error.

This issue was found by our static analysis tool under development.

Fixes: e8aae154df61 ("PCI: rockchip-dwc: Add legacy interrupt support")
Signed-off-by: Guangshuo Li <liguangshuo at mail.sdu.edu.cn>
---
 drivers/pci/controller/dwc/pcie-dw-rockchip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
index ab2e26699409..138f69d0a18c 100644
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -736,6 +736,8 @@ static int rockchip_pcie_configure_rc(struct platform_device *pdev,
 	ret = dw_pcie_host_init(pp);
 	if (ret) {
 		dev_err(dev, "failed to initialize host\n");
+		irq_set_chained_handler_and_data(irq, NULL, NULL);
+		irq_domain_remove(rockchip->irq_domain);
 		return ret;
 	}
 

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244



More information about the Linux-rockchip mailing list