mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 01:51:53 +00:00
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: 72a5af554d
("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>
This commit is contained in:
parent
5603731a15
commit
e5723f95d6
@ -95,7 +95,7 @@ static void mmc_should_fail_request(struct mmc_host *host,
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
if (cmd->error || data->error ||
|
||||
if ((cmd && cmd->error) || data->error ||
|
||||
!should_fail(&host->fail_mmc_request, data->blksz * data->blocks))
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user