summaryrefslogtreecommitdiff
path: root/drivers/pci/host/pcie-iproc-platform.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2015-05-24 23:37:03 +0300
committerBjorn Helgaas <bhelgaas@google.com>2015-05-28 02:34:05 +0300
commitef07991a95de76b07594448c3521361831ec2cfe (patch)
tree028f4d52668d97e3ca04322e004c7a71b154c33f /drivers/pci/host/pcie-iproc-platform.c
parent18c4342aa56d70176eea85021e6fe8f6f8f39c7b (diff)
downloadlinux-ef07991a95de76b07594448c3521361831ec2cfe.tar.xz
PCI: iproc: Free resource list after registration
The resource list is only used in the setup process and was never freed. pci_add_resource() allocates a memory area to store the list item. Fix the memory leak. Tested-by: Ray Jui <rjui@broadcom.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Ray Jui <rjui@broadcom.com>
Diffstat (limited to 'drivers/pci/host/pcie-iproc-platform.c')
-rw-r--r--drivers/pci/host/pcie-iproc-platform.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c
index c5fe4c160972..9aedc8eb2c6e 100644
--- a/drivers/pci/host/pcie-iproc-platform.c
+++ b/drivers/pci/host/pcie-iproc-platform.c
@@ -72,12 +72,12 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
pcie->map_irq = of_irq_parse_and_map_pci;
ret = iproc_pcie_setup(pcie, &res);
- if (ret) {
+ if (ret)
dev_err(pcie->dev, "PCIe controller setup failed\n");
- return ret;
- }
- return 0;
+ pci_free_resource_list(&res);
+
+ return ret;
}
static int iproc_pcie_pltfm_remove(struct platform_device *pdev)