Skip to content

Commit

Permalink
mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish
Browse files Browse the repository at this point in the history
It seems that under certain circumstances the sdhci_tasklet_finish()
call can be entered with mrq set to NULL, causing the system to crash
with a NULL pointer de-reference.

Seen on S3C6410 system.  Based on a patch by Dimitris Papastamos.

Reported-by: Dimitris Papastamos <[email protected]>
Cc: <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
  • Loading branch information
cjb committed Apr 27, 2011
1 parent b7b4d34 commit 0c9c99a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0c9c99a

Please sign in to comment.