Skip to content

Commit fbd986c

Browse files
giometticjb
authored andcommitted
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>
1 parent c1fa342 commit fbd986c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎drivers/mmc/host/atmel-mci.c‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,12 +1810,14 @@ static void atmci_tasklet_func(unsigned long priv)
18101810
if (unlikely(status)) {
18111811
host->stop_transfer(host);
18121812
host->data = NULL;
1813-
if (status & ATMCI_DTOE) {
1814-
data->error = -ETIMEDOUT;
1815-
} else if (status & ATMCI_DCRCE) {
1816-
data->error = -EILSEQ;
1817-
} else {
1818-
data->error = -EIO;
1813+
if (data) {
1814+
if (status & ATMCI_DTOE) {
1815+
data->error = -ETIMEDOUT;
1816+
} else if (status & ATMCI_DCRCE) {
1817+
data->error = -EILSEQ;
1818+
} else {
1819+
data->error = -EIO;
1820+
}
18191821
}
18201822
}
18211823

0 commit comments

Comments
 (0)