Skip to content

Commit

Permalink
PCI: rcar: Fix memory leak when no PCIe card is inserted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Harunobu Kurokawa authored and Bjorn Helgaas committed Aug 15, 2017
1 parent 3c60e01 commit ddd535f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/pci/host/pcie-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)

err_free_bridge:
pci_free_host_bridge(bridge);
pci_free_resource_list(&pcie->resources);

return err;
}
Expand Down

0 comments on commit ddd535f

Please sign in to comment.