omap_hsmmc: Do not expect cmd/data to be non-null when CC/TC occurs
authorJarkko Lavinen <jarkko.lavinen@nokia.com>
Wed, 8 Apr 2009 08:18:32 +0000 (11:18 +0300)
committerPierre Ossman <pierre@ossman.eu>
Wed, 8 Apr 2009 18:43:38 +0000 (20:43 +0200)
With spurious interrupt cmd can be null even when we have CC
set in irq status.

Fixes: NB#106295 - prevent potential kernel crash in the MMC driver
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
drivers/mmc/host/omap_hsmmc.c

index d765df29ee15dd90078ce776edc3d93976324bbe..e62a22a7f00cb10089ab36424793aa498a81284f 100644 (file)
@@ -493,7 +493,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
        /* Flush posted write */
        OMAP_HSMMC_READ(host->base, STAT);
 
-       if (end_cmd || (status & CC))
+       if (end_cmd || ((status & CC) && host->cmd))
                mmc_omap_cmd_done(host, host->cmd);
        if (end_trans || (status & TC))
                mmc_omap_xfer_done(host, data);