Commit bf3240ba authored by Stefan Wahren's avatar Stefan Wahren Committed by Ulf Hansson

mmc: bcm2835: Fix possible NULL ptr dereference in bcm2835_request

This fixes a NULL pointer dereference in case of a MMC request with a
set block count command and no data.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Tested-by: default avatarPeter Robinson <pbrobinson@gmail.com>
Reviewed-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent feeef096
...@@ -1200,7 +1200,8 @@ static void bcm2835_request(struct mmc_host *mmc, struct mmc_request *mrq) ...@@ -1200,7 +1200,8 @@ static void bcm2835_request(struct mmc_host *mmc, struct mmc_request *mrq)
return; return;
} }
host->use_sbc = !!mrq->sbc && (host->mrq->data->flags & MMC_DATA_READ); host->use_sbc = !!mrq->sbc && host->mrq->data &&
(host->mrq->data->flags & MMC_DATA_READ);
if (host->use_sbc) { if (host->use_sbc) {
if (bcm2835_send_command(host, mrq->sbc)) { if (bcm2835_send_command(host, mrq->sbc)) {
if (!host->use_busy) if (!host->use_busy)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment