From: Geert Uytterhoeven Date: Thu, 7 Dec 2017 10:15:20 +0000 (+0100) Subject: PCI: rcar: Handle rcar_pcie_parse_request_of_pci_ranges() failures X-Git-Tag: v4.14.30~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fea718819c6922a0befde4b9f9a760c712c6fabd;p=platform%2Fkernel%2Flinux-rpi.git PCI: rcar: Handle rcar_pcie_parse_request_of_pci_ranges() failures [ 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 Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index f09ff47..8f44a7d 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -1141,7 +1141,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) { @@ -1196,6 +1198,7 @@ err_pm_disable: err_free_resource_list: pci_free_resource_list(&pcie->resources); +err_free_bridge: pci_free_host_bridge(bridge); return err;