From 2c9054dc102742e1683b5d879f7472fb712b7324 Mon Sep 17 00:00:00 2001 From: Simon Baatz Date: Sun, 9 Jun 2013 22:14:12 +0200 Subject: [PATCH] mmc: sh_mmcif: handle mmc_of_parse() errors during probe Signed-off-by: Simon Baatz Acked-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- drivers/mmc/host/sh_mmcif.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 8ef5efad45d0..6706b5e3b974 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1370,7 +1370,11 @@ static int sh_mmcif_probe(struct platform_device *pdev) ret = -ENOMEM; goto ealloch; } - mmc_of_parse(mmc); + + ret = mmc_of_parse(mmc); + if (ret < 0) + goto eofparse; + host = mmc_priv(mmc); host->mmc = mmc; host->addr = reg; @@ -1465,6 +1469,7 @@ eclkupdate: clk_put(host->hclk); eclkget: pm_runtime_disable(&pdev->dev); +eofparse: mmc_free_host(mmc); ealloch: iounmap(reg); -- 2.30.2