]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit2a3fed6ac281114f3fede9005b9377832f4416ca
tree7742a74c0f7fcc7c08ec73f28e56c07963c3c75d
parentc2052b9de108939da22db15574bb187039212015
mmc: core: Fix NULL ptr crash from mmc_should_fail_request

BugLink: https://bugs.launchpad.net/bugs/1837813
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: 72a5af554df8 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/mmc/core/core.c