diff options
-rw-r--r-- | drivers/pci/host/pcie-xilinx.c | 11 |
1 files changed, 8 insertions, 3 deletions
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) | |||
660 | struct xilinx_pcie_port *port; | 660 | struct xilinx_pcie_port *port; |
661 | struct device *dev = &pdev->dev; | 661 | struct device *dev = &pdev->dev; |
662 | struct pci_bus *bus; | 662 | struct pci_bus *bus; |
663 | |||
664 | int err; | 663 | int err; |
665 | resource_size_t iobase = 0; | 664 | resource_size_t iobase = 0; |
666 | LIST_HEAD(res); | 665 | LIST_HEAD(res); |
@@ -696,8 +695,10 @@ static int xilinx_pcie_probe(struct platform_device *pdev) | |||
696 | } | 695 | } |
697 | bus = pci_create_root_bus(&pdev->dev, 0, | 696 | bus = pci_create_root_bus(&pdev->dev, 0, |
698 | &xilinx_pcie_ops, port, &res); | 697 | &xilinx_pcie_ops, port, &res); |
699 | if (!bus) | 698 | if (!bus) { |
700 | return -ENOMEM; | 699 | err = -ENOMEM; |
700 | goto error; | ||
701 | } | ||
701 | 702 | ||
702 | #ifdef CONFIG_PCI_MSI | 703 | #ifdef CONFIG_PCI_MSI |
703 | xilinx_pcie_msi_chip.dev = port->dev; | 704 | xilinx_pcie_msi_chip.dev = port->dev; |
@@ -712,6 +713,10 @@ static int xilinx_pcie_probe(struct platform_device *pdev) | |||
712 | platform_set_drvdata(pdev, port); | 713 | platform_set_drvdata(pdev, port); |
713 | 714 | ||
714 | return 0; | 715 | return 0; |
716 | |||
717 | error: | ||
718 | pci_free_resource_list(&res); | ||
719 | return err; | ||
715 | } | 720 | } |
716 | 721 | ||
717 | /** | 722 | /** |