Skip to content

Commit e5723f9

Browse files
Ritesh Harjanistorulf
authored andcommitted
mmc: core: Fix NULL ptr crash from mmc_should_fail_request
In case of CQHCI, mrq->cmd may be NULL for data requests (non DCMD). In such case mmc_should_fail_request is directly dereferencing mrq->cmd while cmd is NULL. Fix this by checking for mrq->cmd pointer. Fixes: 72a5af5 ("mmc: core: Add support for handling CQE requests") Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 5603731 commit e5723f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/core/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void mmc_should_fail_request(struct mmc_host *host,
9595
if (!data)
9696
return;
9797

98-
if (cmd->error || data->error ||
98+
if ((cmd && cmd->error) || data->error ||
9999
!should_fail(&host->fail_mmc_request, data->blksz * data->blocks))
100100
return;
101101

0 commit comments

Comments
 (0)