[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170802071320.28674-1-harunobu.kurokawa.dn@renesas.com>
Date: Wed, 2 Aug 2017 16:13:20 +0900
From: Harunobu Kurokawa <harunobu.kurokawa.dn@...esas.com>
To: horms@...ge.net.au, bhelgaas@...gle.com, linux-pci@...r.kernel.org
Cc: linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
Harunobu Kurokawa <harunobu.kurokawa.dn@...esas.com>
Subject: [PATCH] PCI: rcar-pcie: Fix memory leak when no PCIe card is inserted
When no PCIe card is inserted, there is a memory leak as
pci_free_resource_list is not called before returning.
Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@...esas.com>
---
drivers/pci/host/pcie-rcar.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index ac80fbb..9b06de6 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -1190,14 +1190,15 @@ static int rcar_pcie_probe(struct platform_device *pdev)
return 0;
-err_free_bridge:
- pci_free_host_bridge(bridge);
-
err_pm_put:
pm_runtime_put(dev);
err_pm_disable:
pm_runtime_disable(dev);
+
+err_free_bridge:
+ pci_free_host_bridge(bridge);
+ pci_free_resource_list(&pcie->resources);
return err;
}
--
2.9.2
Powered by blists - more mailing lists