X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=drivers%2Fpci%2Fhost%2Fpcie-xilinx.c;h=5c456db47c49cac56f068220be8751c46bc051ec;hb=c41be7a695edeb00480a95eaf1c23a76b35f0b8b;hp=65f0fe0c2eafb67141fd84f84b31285ff038c868;hpb=1cbc99dfe5d7d686fd022647f4e489b5eb8e9068;p=deliverable%2Flinux.git diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index 65f0fe0c2eaf..5c456db47c49 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -660,7 +660,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev) struct xilinx_pcie_port *port; struct device *dev = &pdev->dev; struct pci_bus *bus; - int err; resource_size_t iobase = 0; LIST_HEAD(res); @@ -696,8 +695,10 @@ static int xilinx_pcie_probe(struct platform_device *pdev) } bus = pci_create_root_bus(&pdev->dev, 0, &xilinx_pcie_ops, port, &res); - if (!bus) - return -ENOMEM; + if (!bus) { + err = -ENOMEM; + goto error; + } #ifdef CONFIG_PCI_MSI xilinx_pcie_msi_chip.dev = port->dev; @@ -712,6 +713,10 @@ static int xilinx_pcie_probe(struct platform_device *pdev) platform_set_drvdata(pdev, port); return 0; + +error: + pci_free_resource_list(&res); + return err; } /**