From ef07991a95de76b07594448c3521361831ec2cfe Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 24 May 2015 22:37:03 +0200 Subject: 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 Signed-off-by: Hauke Mehrtens Signed-off-by: Bjorn Helgaas Reviewed-by: Ray Jui --- drivers/pci/host/pcie-iproc-bcma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/pci/host/pcie-iproc-bcma.c') diff --git a/drivers/pci/host/pcie-iproc-bcma.c b/drivers/pci/host/pcie-iproc-bcma.c index 7a412a145b51..96a7d999fd5e 100644 --- a/drivers/pci/host/pcie-iproc-bcma.c +++ b/drivers/pci/host/pcie-iproc-bcma.c @@ -65,12 +65,12 @@ static int iproc_pcie_bcma_probe(struct bcma_device *bdev) pcie->map_irq = iproc_pcie_bcma_map_irq; 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 void iproc_pcie_bcma_remove(struct bcma_device *bdev) -- cgit