Calls mmc_host_disable instead of mmc_host_lazy_disable if an error occurs,
thus avoiding to schedule a delayed work that would end up using free'd objects.
---
 drivers/mfd/glamo/glamo-mci.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index 08d0154..c0c58f1 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -840,16 +840,19 @@ static int glamo_mci_probe(struct platform_device *pdev)
 
        mmc_host_enable(mmc);
        glamo_mci_reset(host);
-       mmc_host_lazy_disable(mmc);
 
        ret = mmc_add_host(mmc);
        if (ret) {
                dev_err(&pdev->dev, "failed to add mmc host.\n");
-               goto probe_freeirq;
+               goto probe_mmc_host_disable;
        }
 
+       mmc_host_lazy_disable(mmc);
+
        return 0;
 
+probe_mmc_host_disable:
+       mmc_host_disable(mmc);
 probe_freeirq:
        free_irq(host->irq, host);
 probe_iounmap_data:
@@ -891,6 +894,7 @@ static int glamo_mci_remove(struct platform_device *pdev)
        regulator_put(host->regulator);
 
        mmc_free_host(mmc);
+
        return 0;
 }
 
-- 
1.7.1


Reply via email to