|
@@ -542,12 +542,14 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
|
|
|
|
|
|
ret = xgene_pcie_setup(port, &res, iobase);
|
|
ret = xgene_pcie_setup(port, &res, iobase);
|
|
if (ret)
|
|
if (ret)
|
|
- return ret;
|
|
|
|
|
|
+ goto error;
|
|
|
|
|
|
bus = pci_create_root_bus(&pdev->dev, 0,
|
|
bus = pci_create_root_bus(&pdev->dev, 0,
|
|
&xgene_pcie_ops, port, &res);
|
|
&xgene_pcie_ops, port, &res);
|
|
- if (!bus)
|
|
|
|
- return -ENOMEM;
|
|
|
|
|
|
+ if (!bus) {
|
|
|
|
+ ret = -ENOMEM;
|
|
|
|
+ goto error;
|
|
|
|
+ }
|
|
|
|
|
|
pci_scan_child_bus(bus);
|
|
pci_scan_child_bus(bus);
|
|
pci_assign_unassigned_bus_resources(bus);
|
|
pci_assign_unassigned_bus_resources(bus);
|
|
@@ -555,6 +557,10 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
|
|
|
|
|
|
platform_set_drvdata(pdev, port);
|
|
platform_set_drvdata(pdev, port);
|
|
return 0;
|
|
return 0;
|
|
|
|
+
|
|
|
|
+error:
|
|
|
|
+ pci_free_resource_list(&res);
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
static const struct of_device_id xgene_pcie_match_table[] = {
|
|
static const struct of_device_id xgene_pcie_match_table[] = {
|