Explorar o código

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>
Michael Buesch %!s(int64=14) %!d(string=hai) anos
pai
achega
f694751421
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/mmc/host/omap.c

+ 1 - 1
drivers/mmc/host/omap.c

@@ -832,7 +832,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 		return IRQ_HANDLED;
 		return IRQ_HANDLED;
 	}
 	}
 
 
-	if (end_command)
+	if (end_command && host->cmd)
 		mmc_omap_cmd_done(host, host->cmd);
 		mmc_omap_cmd_done(host, host->cmd);
 	if (host->data != NULL) {
 	if (host->data != NULL) {
 		if (transfer_error)
 		if (transfer_error)