mmc: omap: Fix possible NULL pointer deref
authorMichael Buesch <mb@bu3sch.de>
Mon, 11 Apr 2011 21:00:44 +0000 (17:00 -0400)
committerChris Ball <cjb@laptop.org>
Wed, 27 Apr 2011 23:15:12 +0000 (19:15 -0400)
Either OMAP_MMC_STAT_CARD_ERR or OMAP_MMC_STAT_END_OF_CMD might fire
if there is no host->cmd pointer.

Check for a valid host->cmd pointer before calling mmc_omap_cmd_done().

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/omap.c

index 2e032f0..a6c3290 100644 (file)
@@ -832,7 +832,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                return IRQ_HANDLED;
        }
 
-       if (end_command)
+       if (end_command && host->cmd)
                mmc_omap_cmd_done(host, host->cmd);
        if (host->data != NULL) {
                if (transfer_error)