From patchwork Wed Apr 8 08:18:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 17049 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n388JTqr024210 for ; Wed, 8 Apr 2009 08:19:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763626AbZDHISH (ORCPT ); Wed, 8 Apr 2009 04:18:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762224AbZDHISH (ORCPT ); Wed, 8 Apr 2009 04:18:07 -0400 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 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx03.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n388He0c011392; Wed, 8 Apr 2009 11:17:51 +0300 Received: from vaepf101.NOE.Nokia.com ([10.160.244.86]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 8 Apr 2009 11:17:30 +0300 Received: from [172.21.41.224] ([172.21.41.224]) by vaepf101.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 8 Apr 2009 11:17:30 +0300 Message-ID: <49DC5DD8.2070208@nokia.com> Date: Wed, 08 Apr 2009 11:18:32 +0300 From: Adrian Hunter User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Pierre Ossman CC: "Lavinen Jarkko (Nokia-M/Helsinki)" , LKML , linux-omap Mailing List , Tony Lindgren Subject: [PATCH] HSMMC: mmc_omap_irq: Do not expect cmd/data to be non-null when CC/TC occurs X-OriginalArrivalTime: 08 Apr 2009 08:17:31.0002 (UTC) FILETIME=[764E6DA0:01C9B822] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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);