diff options
| author | Rodolfo Giometti <giometti@enneenne.com> | 2013-09-09 11:31:59 -0400 |
|---|---|---|
| committer | Chris Ball <cjb@laptop.org> | 2013-09-25 21:46:11 -0400 |
| commit | fbd986cd420d1deeabf1039ec4e74075a5639db5 (patch) | |
| tree | ab8b82ee748d62b563abeab4508ea3dcd806ae1f | |
| parent | c1fa3426aa5c782724c97394303d52228206eda4 (diff) | |
mmc: atmel-mci: fix oops in atmci_tasklet_func
In some cases, a NULL pointer dereference happens because data is NULL when
STATE_END_REQUEST case is reached in atmci_tasklet_func.
Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: Rodolfo Giometti <giometti@enneenne.com>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
| -rw-r--r-- | drivers/mmc/host/atmel-mci.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index b8dfe0d8adbb..92c18779d47e 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
| @@ -1810,12 +1810,14 @@ static void atmci_tasklet_func(unsigned long priv) | |||
| 1810 | if (unlikely(status)) { | 1810 | if (unlikely(status)) { |
| 1811 | host->stop_transfer(host); | 1811 | host->stop_transfer(host); |
| 1812 | host->data = NULL; | 1812 | host->data = NULL; |
| 1813 | if (status & ATMCI_DTOE) { | 1813 | if (data) { |
| 1814 | data->error = -ETIMEDOUT; | 1814 | if (status & ATMCI_DTOE) { |
| 1815 | } else if (status & ATMCI_DCRCE) { | 1815 | data->error = -ETIMEDOUT; |
| 1816 | data->error = -EILSEQ; | 1816 | } else if (status & ATMCI_DCRCE) { |
| 1817 | } else { | 1817 | data->error = -EILSEQ; |
| 1818 | data->error = -EIO; | 1818 | } else { |
| 1819 | data->error = -EIO; | ||
| 1820 | } | ||
| 1819 | } | 1821 | } |
| 1820 | } | 1822 | } |
| 1821 | 1823 | ||
