[3.11.y.z extended stable] Patch "mmc: atmel-mci: fix oops in atmci_tasklet_func" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Dec 5 11:23:20 UTC 2013


This is a note to let you know that I have just added a patch titled

    mmc: atmel-mci: fix oops in atmci_tasklet_func

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From db999eaa5643e7377d64d3266dc80652cfa1be6a Mon Sep 17 00:00:00 2001
From: Rodolfo Giometti <giometti at enneenne.com>
Date: Mon, 9 Sep 2013 17:31:59 +0200
Subject: mmc: atmel-mci: fix oops in atmci_tasklet_func

commit fbd986cd420d1deeabf1039ec4e74075a5639db5 upstream.

In some cases, a NULL pointer dereference happens because data is NULL when
STATE_END_REQUEST case is reached in atmci_tasklet_func.

Signed-off-by: Rodolfo Giometti <giometti at enneenne.com>
Acked-by: Ludovic Desroches <ludovic.desroches at atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre at atmel.com>
Signed-off-by: Chris Ball <cjb at laptop.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/mmc/host/atmel-mci.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index e9ea2fc..78d7e47 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1792,12 +1792,14 @@ static void atmci_tasklet_func(unsigned long priv)
 			if (unlikely(status)) {
 				host->stop_transfer(host);
 				host->data = NULL;
-				if (status & ATMCI_DTOE) {
-					data->error = -ETIMEDOUT;
-				} else if (status & ATMCI_DCRCE) {
-					data->error = -EILSEQ;
-				} else {
-					data->error = -EIO;
+				if (data) {
+					if (status & ATMCI_DTOE) {
+						data->error = -ETIMEDOUT;
+					} else if (status & ATMCI_DCRCE) {
+						data->error = -EILSEQ;
+					} else {
+						data->error = -EIO;
+					}
 				}
 			}

--
1.8.3.2





More information about the kernel-team mailing list