diff options
author | Pali Rohár <[email protected]> | 2021-11-30 18:29:10 +0100 |
---|---|---|
committer | Lorenzo Pieralisi <[email protected]> | 2021-12-02 09:55:49 +0000 |
commit | 2f040a17f5061457ae95035326d3159eddc1e5cc (patch) | |
tree | 3a8c661a22b9542ef2278caade3820b1a9d1df66 | |
parent | 13bcdf07cb2ecff5d45d2c141df2539b15211448 (diff) |
PCI: aardvark: Fix memory leak in driver unbind
Free config space for emulated root bridge when unbinding driver to fix
memory leak. Do it after disabling and masking all interrupts, since
aardvark interrupt handler accesses config space of emulated root
bridge.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Marek Behún <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
-rw-r--r-- | drivers/pci/controller/pci-aardvark.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 08b34accfe2f..b3d89cb449b6 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -1734,6 +1734,9 @@ static int advk_pcie_remove(struct platform_device *pdev) advk_pcie_remove_msi_irq_domain(pcie); advk_pcie_remove_irq_domain(pcie); + /* Free config space for emulated root bridge */ + pci_bridge_emul_cleanup(&pcie->bridge); + /* Disable outbound address windows mapping */ for (i = 0; i < OB_WIN_COUNT; i++) advk_pcie_disable_ob_win(pcie, i); |