mmc: sdhci-st: Do cleanup while mmc_of_parse() return an error
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 18 Dec 2014 09:41:43 +0000 (10:41 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 19 Jan 2015 08:56:14 +0000 (09:56 +0100)
At errors, balance sdhci_pltfm_init() with sdhci_pltfm_free(), to make
sure all data is freed properly.

Cc: Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
Cc: Maxime Coquelin <maxime.coquelin@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
drivers/mmc/host/sdhci-st.c

index 328f348c72439ee5027a68a46c3224f1f2cef68b..882b07e9667e20d3675620152cf108fc55f2a3ae 100644 (file)
@@ -78,10 +78,9 @@ static int sdhci_st_probe(struct platform_device *pdev)
        }
 
        ret = mmc_of_parse(host->mmc);
-
        if (ret) {
                dev_err(&pdev->dev, "Failed mmc_of_parse\n");
-               return ret;
+               goto err_of;
        }
 
        clk_prepare_enable(clk);
@@ -108,6 +107,7 @@ static int sdhci_st_probe(struct platform_device *pdev)
 
 err_out:
        clk_disable_unprepare(clk);
+err_of:
        sdhci_pltfm_free(pdev);
 
        return ret;