From: Ulf Hansson Date: Thu, 18 Dec 2014 09:41:43 +0000 (+0100) Subject: mmc: sdhci-st: Do cleanup while mmc_of_parse() return an error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc702cb35dcb660eefb27e9dc1fe93aed9f39f64;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mmc: sdhci-st: Do cleanup while mmc_of_parse() return an error At errors, balance sdhci_pltfm_init() with sdhci_pltfm_free(), to make sure all data is freed properly. Cc: Srinivas Kandagatla Cc: Maxime Coquelin Cc: Patrice Chotard Signed-off-by: Ulf Hansson Acked-by: Maxime Coquelin --- diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index 328f348c7243..882b07e9667e 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c @@ -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;