OSDN Git Service

mmc: core: Fix NULL pointer dereference issue with mmc_blk_reset()
authorSahitya Tummala <stummala@codeaurora.org>
Fri, 30 May 2014 03:52:35 +0000 (09:22 +0530)
committerSubhash Jadavani <subhashj@codeaurora.org>
Tue, 31 May 2016 22:25:59 +0000 (15:25 -0700)
commitc250bf69fda3120c4b47e41aa61cbad349b7df7a
tree0dbee6879f638cff144e83a0616b4db60c599212
parent3332d5a9e4fe04b14c3008d432a031c22a38bd2c
mmc: core: Fix NULL pointer dereference issue with mmc_blk_reset()

If the mmc_hw_reset() fails, then host->card might be NULL in some
cases. Hence, check for reset errors and report it to the caller so
that the current request can be aborted and also check for host->card
before accessing it so as to prevent NULL pointer dereference issue.

Change-Id: Iba0f0be314474e607a40383bc0b28eef66a31d63
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
drivers/mmc/card/block.c