PCI: rcar: Don't disable/unprepare clocks on prepare/enable failure
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 31 Aug 2016 09:28:22 +0000 (11:28 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 12 Sep 2016 22:15:09 +0000 (17:15 -0500)
If clk_prepare_enable() fails, we must not call clk_disable_unprepare() in
the error path.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pcie-rcar.c

index e58bbbc0f0b5d164223f1ea1df3292891f470ca6..45dc3cd74c0375e08bd54798de9223cf7b044213 100644 (file)
@@ -786,7 +786,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
        }
        err = clk_prepare_enable(pcie->clk);
        if (err)
-               goto fail_clk;
+               return err;
 
        pcie->bus_clk = devm_clk_get(&pdev->dev, "pcie_bus");
        if (IS_ERR(pcie->bus_clk)) {
@@ -796,7 +796,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev,
        }
        err = clk_prepare_enable(pcie->bus_clk);
        if (err)
-               goto err_map_reg;
+               goto fail_clk;
 
        i = irq_of_parse_and_map(pdev->dev.of_node, 0);
        if (!i) {