]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: Fix NULL ptr crash from mmc_should_fail_request
authorRitesh Harjani <riteshh@codeaurora.org>
Fri, 22 Feb 2019 13:51:34 +0000 (19:21 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 27 Feb 2019 09:00:17 +0000 (10:00 +0100)
commit384034c6805f5f862b55ef0b838565de55fbae24
tree9d156ff32fb2359b9e4f1449ea7fe8e75c813769
parentb3a332f2bd703b2b1aaf7b522b3f86814f4e9e8e
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: 24d778b694c9 ("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>
drivers/mmc/core/core.c