Skip to content

Commit 2f040a1

Browse files
paliLorenzo Pieralisi
authored andcommitted
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/20211130172913.9727-9-kabel@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 13bcdf0 commit 2f040a1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/pci/controller/pci-aardvark.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,9 @@ static int advk_pcie_remove(struct platform_device *pdev)
17341734
advk_pcie_remove_msi_irq_domain(pcie);
17351735
advk_pcie_remove_irq_domain(pcie);
17361736

1737+
/* Free config space for emulated root bridge */
1738+
pci_bridge_emul_cleanup(&pcie->bridge);
1739+
17371740
/* Disable outbound address windows mapping */
17381741
for (i = 0; i < OB_WIN_COUNT; i++)
17391742
advk_pcie_disable_ob_win(pcie, i);

0 commit comments

Comments
 (0)