aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2011-04-11 17:00:44 -0400
committerNicolas Pitre <nicolas.pitre@linaro.org>2011-05-16 13:34:37 -0400
commit2a0ee71ab8ac0031939a6d33c3f39139f5ba8c0d (patch)
tree53e2b3c3bdf12a3b473faee226cf239474c6962b /drivers
parent8440c5d50d9cde8c4072771f3e61001db06a3d05 (diff)
downloadlinux-linaro-android-2a0ee71ab8ac0031939a6d33c3f39139f5ba8c0d.tar.gz
mmc: omap: Fix possible NULL pointer deref
Either OMAP_MMC_STAT_CARD_ERR or OMAP_MMC_STAT_END_OF_CMD might fire if there is no host->cmd pointer. Check for a valid host->cmd pointer before calling mmc_omap_cmd_done(). Signed-off-by: Michael Buesch <mb@bu3sch.de> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Chris Ball <cjb@laptop.org> (cherry picked from commit f69475142136c8ad9b9c717aea2ff907aed9f863)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/omap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 379d2ffe4c8..85524d3acad 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -832,7 +832,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}
- if (end_command)
+ if (end_command && host->cmd)
mmc_omap_cmd_done(host, host->cmd);
if (host->data != NULL) {
if (transfer_error)