diff mbox

HSMMC: mmc_omap_irq: Do not expect cmd/data to be non-null when CC/TC occurs

Message ID 49DC5DD8.2070208@nokia.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Adrian Hunter April 8, 2009, 8:18 a.m. UTC
From: Jarkko Lavinen <jarkko.lavinen@nokia.com>

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>
---
 drivers/mmc/host/omap_hsmmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Pierre Ossman April 8, 2009, 6:43 p.m. UTC | #1
On Wed, 08 Apr 2009 11:18:32 +0300
Adrian Hunter <adrian.hunter@nokia.com> wrote:

> From: Jarkko Lavinen <jarkko.lavinen@nokia.com>
> 
> 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>
> ---

Queued.
diff mbox

Patch

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index d183be6..0268992 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -490,7 +490,7 @@  static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 
 	OMAP_HSMMC_WRITE(host->base, STAT, status);
 
-	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);