This is a note to let you know that I've just added the patch titled

    mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish

to the 2.6.38-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mmc-sdhci-check-mrq-null-in-sdhci_tasklet_finish.patch
and it can be found in the queue-2.6.38 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 0c9c99a765321104cc5f9c97f949382a9ba4927e Mon Sep 17 00:00:00 2001
From: Chris Ball <[email protected]>
Date: Wed, 27 Apr 2011 17:35:31 -0400
Subject: mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish

From: Chris Ball <[email protected]>

commit 0c9c99a765321104cc5f9c97f949382a9ba4927e upstream.

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]>
Signed-off-by: Chris Ball <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/mmc/host/sdhci.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1334,6 +1334,13 @@ static void sdhci_tasklet_finish(unsigne
 
        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);


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.38/mmc-sdhci-pci-fix-error-case-in-sdhci_pci_probe_slot.patch
queue-2.6.38/mmc-sdhci-check-mrq-cmd-in-sdhci_tasklet_finish.patch
queue-2.6.38/mmc-fix-a-race-between-card-detect-rescan-and-clock-gate-work-instances.patch
queue-2.6.38/mmc-sdhci-check-mrq-null-in-sdhci_tasklet_finish.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to