summaryrefslogtreecommitdiff
path: root/drivers/pci/host/pci-xgene.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2017-02-22 00:16:08 +0300
committerBjorn Helgaas <bhelgaas@google.com>2017-02-22 00:16:08 +0300
commit9d534265bdcd47659c9fd080fff4c005512c4770 (patch)
treeeb112e2bbd40816a213f479199572f051c22b7fb /drivers/pci/host/pci-xgene.c
parentf08bf55e690ebdac28402955ef953e11ff478668 (diff)
parent7da7a1a66e7700903bbc9ed09256fc95da34d43d (diff)
downloadlinux-9d534265bdcd47659c9fd080fff4c005512c4770.tar.xz
Merge branch 'pci/host-xgene' into next
* pci/host-xgene: PCI: xgene: Configure PCIe MPS settings PCI: xgene: Fix double free on init error
Diffstat (limited to 'drivers/pci/host/pci-xgene.c')
-rw-r--r--drivers/pci/host/pci-xgene.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index 7c3b54b9eb17..1a6108788f6f 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -246,14 +246,11 @@ static int xgene_pcie_ecam_init(struct pci_config_window *cfg, u32 ipversion)
ret = xgene_get_csr_resource(adev, &csr);
if (ret) {
dev_err(dev, "can't get CSR resource\n");
- kfree(port);
return ret;
}
port->csr_base = devm_ioremap_resource(dev, &csr);
- if (IS_ERR(port->csr_base)) {
- kfree(port);
- return -ENOMEM;
- }
+ if (IS_ERR(port->csr_base))
+ return PTR_ERR(port->csr_base);
port->cfg_base = cfg->win;
port->version = ipversion;
@@ -638,7 +635,7 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
struct device_node *dn = dev->of_node;
struct xgene_pcie_port *port;
resource_size_t iobase = 0;
- struct pci_bus *bus;
+ struct pci_bus *bus, *child;
int ret;
LIST_HEAD(res);
@@ -681,6 +678,8 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
pci_scan_child_bus(bus);
pci_assign_unassigned_bus_resources(bus);
+ list_for_each_entry(child, &bus->children, node)
+ pcie_bus_configure_settings(child);
pci_bus_add_devices(bus);
return 0;