From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Hunter Subject: [PATCH] HSMMC: mmc_omap_irq: Do not expect cmd/data to be non-null when CC/TC occurs Date: Wed, 08 Apr 2009 11:18:32 +0300 Message-ID: <49DC5DD8.2070208@nokia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.nokia.com ([192.100.122.230]:27081 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763616AbZDHISD (ORCPT ); Wed, 8 Apr 2009 04:18:03 -0400 Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Pierre Ossman Cc: "Lavinen Jarkko (Nokia-M/Helsinki)" , LKML , linux-omap Mailing List , Tony Lindgren From: Jarkko Lavinen 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 Signed-off-by: Adrian Hunter --- 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