Skip to content

Commit

Permalink
mmc: omap: Fix possible NULL pointer deref
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Buesch authored and Chris Ball committed Apr 27, 2011
1 parent 9bc2184 commit f694751
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f694751

Please sign in to comment.