summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-03 09:24:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-03 09:24:44 -0700
commit9a6cd4b45a1372b04bb4c3307f1ce79a0a2e2fa9 (patch)
treed4672f9b0388ab49f8e279e9fd69b682549e002c /drivers/mmc/host/sdhci.c
parentbab0dcc717e28f76f10337a26ed5a14adcd786ce (diff)
parent0c9c99a765321104cc5f9c97f949382a9ba4927e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish mmc: sdhci: Check mrq->cmd in sdhci_tasklet_finish mmc: tmio: fix .set_ios(MMC_POWER_UP) handling mmc: fix a race between card-detect rescan and clock-gate work instances mmc: omap: Fix possible NULL pointer deref mmc: core: mmc_add_card(): fix missing break in switch statement mmc: sdhci-pci: Fix error case in sdhci_pci_probe_slot()
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9e15f41f87be..5d20661bc357 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1334,6 +1334,13 @@ static void sdhci_tasklet_finish(unsigned long param)
host = (struct sdhci_host*)param;
+ /*
+ * If this tasklet gets rescheduled while running, it will
+ * be run again afterwards but without any active request.
+ */
+ if (!host->mrq)
+ return;
+
spin_lock_irqsave(&host->lock, flags);
del_timer(&host->timer);
@@ -1345,7 +1352,7 @@ static void sdhci_tasklet_finish(unsigned long param)
* upon error conditions.
*/
if (!(host->flags & SDHCI_DEVICE_DEAD) &&
- (mrq->cmd->error ||
+ ((mrq->cmd && mrq->cmd->error) ||
(mrq->data && (mrq->data->error ||
(mrq->data->stop && mrq->data->stop->error))) ||
(host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {