mmc: atmel-mci: fix oops in atmci_tasklet_func
PATCH 1/1 mmc: atmel-mci: fix oops in atmci_tasklet_func
From: Rodolfo Giometti <[email protected]>
In some cases, a NULL pointer dereference happens because data is NULL when STATE_END_REQUEST case is reached in atmci_tasklet_func.
Cc <[email protected]> #3.9+
Signed-off-by Rodolfo Giometti <[email protected]>
--- drivers/mmc/host/atmel-mci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/mmc/host/atmel-mci.c +8 -6
@@ -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 ; + } } }
Signature · 1 line
1.7.11.3
PATCH 1/1 mmc: atmel-mci: fix oops in atmci_tasklet_func
On 09/09/2013 17:31, ludovic.desroches at atmel.com :
Quoted 8 lines
From: Rodolfo Giometti <[email protected]>
In some cases, a NULL pointer dereference happens because data is NULL when
STATE_END_REQUESTcase is reached inatmci_tasklet_func.Cc <[email protected]> #3.9+Signed-off-by Rodolfo Giometti <[email protected]>
Acked-by Nicolas Ferre <[email protected]>
Thanks, bye.
Quoted 30 lines
--- drivers/mmc/host/atmel-mci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)drivers/mmc/host/atmel-mci.c +8
-6@@ -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 ; + } } }
Signature · 1 line
Nicolas Ferre