Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: dw_mmc: Fix NULL pointer dereference

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>

authored by

Sachin Kamat and committed by
Chris Ball
17c8bc85 550459ee

+1 -1
+1 -1
drivers/mmc/host/dw_mmc.c
··· 1345 1345 1346 1346 if (!err) { 1347 1347 if (!data->stop || mrq->sbc) { 1348 - if (mrq->sbc) 1348 + if (mrq->sbc && data->stop) 1349 1349 data->stop->error = 0; 1350 1350 dw_mci_request_end(host, mrq); 1351 1351 goto unlock;