Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17bf9612 authored by Ritesh Harjani's avatar Ritesh Harjani Committed by Greg Kroah-Hartman
Browse files

mmc: core: Fix NULL ptr crash from mmc_should_fail_request



commit e5723f95d6b493dd437f1199cacb41459713b32f upstream.

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: 72a5af55 ("mmc: core: Add support for handling CQE requests")
Signed-off-by: default avatarRitesh Harjani <riteshh@codeaurora.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85d9ad40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;