summaryrefslogtreecommitdiff
path: root/drivers/pci/host
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-09-07 13:24:05 -0500
committerBjorn Helgaas <bhelgaas@google.com>2017-09-07 13:24:05 -0500
commit3d499a955a30ef1bb9b2176ecb1d3a6be8e3ef9c (patch)
treea1608c41d763a23bbe92bae302b6dd138500b764 /drivers/pci/host
parentcb9d4f00312c27f5562e5ff99d391a6b61102345 (diff)
parentc31c83c970165b9f2cb4c0ad6ae89d0a8242cf7b (diff)
Merge branch 'pci/host-rcar' into next
* pci/host-rcar: PCI: rcar: Add device tree support for r8a7743/5 PCI: rcar: Fix memory leak when no PCIe card is inserted PCI: rcar: Fix error exit path
Diffstat (limited to 'drivers/pci/host')
-rw-r--r--drivers/pci/host/pcie-rcar.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 246d485b24c6..4e0b25d09b0c 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -471,10 +471,8 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie)
bridge->msi = &pcie->msi.chip;
ret = pci_scan_root_bus_bridge(bridge);
- if (ret < 0) {
- kfree(bridge);
+ if (ret < 0)
return ret;
- }
bus = bridge->bus;
@@ -1190,14 +1188,16 @@ 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;
}