PCI: rockchip: Remove IRQ domain if probe fails
authorJeffy Chen <jeffy.chen@rock-chips.com>
Wed, 23 Aug 2017 07:03:31 +0000 (15:03 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 18:18:08 +0000 (13:18 -0500)
Call irq_domain_remove() to clean up if probe fails.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-rockchip.c

index ac8b8e8..f8763f0 100644 (file)
@@ -1567,7 +1567,7 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
        err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff,
                                               &res, &io_base);
        if (err)
-               goto err_deinit_port;
+               goto err_remove_irq_domain;
 
        err = devm_request_pci_bus_resources(dev, &res);
        if (err)
@@ -1639,6 +1639,8 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
 
 err_free_res:
        pci_free_resource_list(&res);
+err_remove_irq_domain:
+       irq_domain_remove(rockchip->irq_domain);
 err_deinit_port:
        rockchip_pcie_deinit_phys(rockchip);
 err_vpcie: