]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
PCI: rcar: Handle rcar_pcie_parse_request_of_pci_ranges() failures
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 7 Dec 2017 10:15:20 +0000 (11:15 +0100)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Mon, 26 Mar 2018 12:16:28 +0000 (09:16 -0300)
BugLink: http://bugs.launchpad.net/bugs/1758886
[ Upstream commit 83c75ddd816e979802bd244ad494139f28152921 ]

rcar_pcie_parse_request_of_pci_ranges() can fail and return an error
code, but this is not checked nor handled.

Fix this by adding the missing error handling.

Fixes: 5d2917d469faab72 ("PCI: rcar: Convert to DT resource parsing API")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/pci/host/pcie-rcar.c

index 52ab3cb0a0bfe065d8209201cbf03a7ef15cdfa4..95ca4a1feba4b7593f16447518b9266205546e0f 100644 (file)
@@ -1123,7 +1123,9 @@ static int rcar_pcie_probe(struct platform_device *pdev)
 
        INIT_LIST_HEAD(&pcie->resources);
 
-       rcar_pcie_parse_request_of_pci_ranges(pcie);
+       err = rcar_pcie_parse_request_of_pci_ranges(pcie);
+       if (err)
+               goto err_free_bridge;
 
        err = rcar_pcie_get_resources(pcie);
        if (err < 0) {
@@ -1178,6 +1180,7 @@ err_pm_disable:
 
 err_free_resource_list:
        pci_free_resource_list(&pcie->resources);
+err_free_bridge:
        pci_free_host_bridge(bridge);
 
        return err;