The driver suppresses userspace bind attributes but still registers a module exit callback. Unloading it leaves the PCI hierarchy and unmanaged IRQ domains and handlers referring to released resources and unloaded driver code. Removing only the root bus does not make the remaining IRQ state safe. Register the driver without an exit callback so a normally loaded module cannot be unloaded. This follows the maintainer's suggested first step while complete controller removal remains unsupported. Keep the tristate option, so loading the driver as a module remains possible. This change addresses module unload, not dynamic removal of the platform device or existing probe-error cleanup. Found by the author's in-house static analysis tool. Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") Cc: stable@vger.kernel.org Suggested-by: Marc Zyngier Link: https://lore.kernel.org/all/87mrrj8ku6.wl-maz@kernel.org/ Signed-off-by: Hongyan Xu Signed-off-by: Zehao Gao --- Discovery: found by the author's in-house static analysis tool. drivers/pci/controller/pcie-apple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index dfd0e34..061742b 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -892,7 +892,7 @@ static struct platform_driver apple_pcie_driver = { .suppress_bind_attrs = true, }, }; -module_platform_driver(apple_pcie_driver); +builtin_platform_driver(apple_pcie_driver); MODULE_DESCRIPTION("Apple PCIe host bridge driver"); MODULE_LICENSE("GPL v2"); -- 2.50.1.windows.1