From: Ulf Hansson Date: Thu, 18 Dec 2014 09:41:41 +0000 (+0100) Subject: mmc: sdhci-of-esdhc: Handle error from mmc_of_parse() X-Git-Tag: v4.0-rc1~124^2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0991408aef9efaedff51e58616b15ecab428135;p=thirdparty%2Fkernel%2Flinux.git mmc: sdhci-of-esdhc: Handle error from mmc_of_parse() Since mmc_of_parse() may fail, let's deal with it and thus do proper error handling. Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 4a654d4ec8db3..17fe02ed66726 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -370,13 +370,19 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) } /* call to generic mmc_of_parse to support additional capabilities */ - mmc_of_parse(host->mmc); + ret = mmc_of_parse(host->mmc); + if (ret) + goto err; + mmc_of_parse_voltage(np, &host->ocr_mask); ret = sdhci_add_host(host); if (ret) - sdhci_pltfm_free(pdev); + goto err; + return 0; + err: + sdhci_pltfm_free(pdev); return ret; }