PCI: rcar: Fix memory leak when no PCIe card is inserted
authorHarunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
Fri, 4 Aug 2017 03:32:55 +0000 (12:32 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 15 Aug 2017 22:51:59 +0000 (17:51 -0500)
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@renesas.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
drivers/pci/host/pcie-rcar.c

index 007523e85c668564939a536c17bfa919eeda8f7e..4e0b25d09b0c72e73c720556bc7e0a066ff0094b 100644 (file)
@@ -1196,6 +1196,7 @@ err_pm_disable:
 
 err_free_bridge:
        pci_free_host_bridge(bridge);
+       pci_free_resource_list(&pcie->resources);
 
        return err;
 }