mmc: dw_mmc: Fix NULL pointer dereference
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 25 Feb 2014 09:48:28 +0000 (15:18 +0530)
committerChris Ball <chris@printf.net>
Tue, 25 Feb 2014 20:43:27 +0000 (15:43 -0500)
If mrq->sbc is not NULL but data->stop happens to be NULL,
it will lead to NULL pointer dereferencing. Avoid this by
having a NULL check for data->stop.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <chris@printf.net>
drivers/mmc/host/dw_mmc.c

index 55cd110a49c4009451b0ca4b35144c8631b8c7d1..0c56faa6730efc8ac55704a70e7fe373fd2c175d 100644 (file)
@@ -1345,7 +1345,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
 
                        if (!err) {
                                if (!data->stop || mrq->sbc) {
-                                       if (mrq->sbc)
+                                       if (mrq->sbc && data->stop)
                                                data->stop->error = 0;
                                        dw_mci_request_end(host, mrq);
                                        goto unlock;