diff options
author | Rodolfo Giometti <giometti@enneenne.com> | 2013-09-09 11:31:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-04 13:56:40 -0500 |
commit | 63a23e393fed93ca823f7c7fc415795e2ffe7670 (patch) | |
tree | 368105e925d617d4a7820925cc454b5c55253f88 /drivers/mmc/host | |
parent | 6edfd0331f788a5d62736c6a422488708175b4c4 (diff) |
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@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc/host')
-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 5d68ac958112..b5c95043f7ef 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -1794,12 +1794,14 @@ static void atmci_tasklet_func(unsigned long priv) | |||
1794 | if (unlikely(status)) { | 1794 | if (unlikely(status)) { |
1795 | host->stop_transfer(host); | 1795 | host->stop_transfer(host); |
1796 | host->data = NULL; | 1796 | host->data = NULL; |
1797 | if (status & ATMCI_DTOE) { | 1797 | if (data) { |
1798 | data->error = -ETIMEDOUT; | 1798 | if (status & ATMCI_DTOE) { |
1799 | } else if (status & ATMCI_DCRCE) { | 1799 | data->error = -ETIMEDOUT; |
1800 | data->error = -EILSEQ; | 1800 | } else if (status & ATMCI_DCRCE) { |
1801 | } else { | 1801 | data->error = -EILSEQ; |
1802 | data->error = -EIO; | 1802 | } else { |
1803 | data->error = -EIO; | ||
1804 | } | ||
1803 | } | 1805 | } |
1804 | } | 1806 | } |
1805 | 1807 | ||