public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HSMMC: mmc_omap_irq: Do not expect cmd/data to be non-null when CC/TC occurs
@ 2009-04-08  8:18 Adrian Hunter
  2009-04-08 18:43 ` Pierre Ossman
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Hunter @ 2009-04-08  8:18 UTC (permalink / raw)
  To: Pierre Ossman
  Cc: Lavinen Jarkko (Nokia-M/Helsinki), LKML, linux-omap Mailing List,
	Tony Lindgren

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(-)

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);
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-08 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08  8:18 [PATCH] HSMMC: mmc_omap_irq: Do not expect cmd/data to be non-null when CC/TC occurs Adrian Hunter
2009-04-08 18:43 ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox