mmc: sh_mmcif: handle mmc_of_parse() errors during probe
authorSimon Baatz <gmbnomis@gmail.com>
Sun, 9 Jun 2013 20:14:12 +0000 (22:14 +0200)
committerChris Ball <cjb@laptop.org>
Thu, 27 Jun 2013 14:22:50 +0000 (10:22 -0400)
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sh_mmcif.c

index 8ef5efa..6706b5e 100644 (file)
@@ -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);