2
0

850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. From 2f040a17f5061457ae95035326d3159eddc1e5cc Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <[email protected]>
  3. Date: Tue, 30 Nov 2021 18:29:10 +0100
  4. Subject: [PATCH] PCI: aardvark: Fix memory leak in driver unbind
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Free config space for emulated root bridge when unbinding driver to fix
  9. memory leak. Do it after disabling and masking all interrupts, since
  10. aardvark interrupt handler accesses config space of emulated root
  11. bridge.
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Pali Rohár <[email protected]>
  14. Signed-off-by: Marek Behún <[email protected]>
  15. Signed-off-by: Lorenzo Pieralisi <[email protected]>
  16. ---
  17. drivers/pci/controller/pci-aardvark.c | 3 +++
  18. 1 file changed, 3 insertions(+)
  19. --- a/drivers/pci/controller/pci-aardvark.c
  20. +++ b/drivers/pci/controller/pci-aardvark.c
  21. @@ -1733,6 +1733,9 @@ static int advk_pcie_remove(struct platf
  22. advk_pcie_remove_msi_irq_domain(pcie);
  23. advk_pcie_remove_irq_domain(pcie);
  24. + /* Free config space for emulated root bridge */
  25. + pci_bridge_emul_cleanup(&pcie->bridge);
  26. +
  27. /* Disable outbound address windows mapping */
  28. for (i = 0; i < OB_WIN_COUNT; i++)
  29. advk_pcie_disable_ob_win(pcie, i);