mmc: core: Fix possible NULL pointer dereference

Add necessary sanity checks to fix possible NULL pointer
deference within function mmc_suspend_host().

CRs-fixed: 566915
Change-Id: I806b0384e0ba6b7d51629390d04d6cf24db27a11
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
This commit is contained in:
Sahitya Tummala 2013-11-05 16:28:21 +05:30
parent bcb87d5a2a
commit 11f2e46a4a
1 changed files with 7 additions and 4 deletions

View File

@ -3617,11 +3617,14 @@ int mmc_suspend_host(struct mmc_host *host)
if (!err) {
if (host->bus_ops->suspend) {
err = mmc_stop_bkops(host->card);
if (err)
goto out;
if (host->card) {
err = mmc_stop_bkops(host->card);
if (err)
goto out;
}
err = host->bus_ops->suspend(host);
MMC_UPDATE_BKOPS_STATS_SUSPEND(host->
if (host->card)
MMC_UPDATE_BKOPS_STATS_SUSPEND(host->
card->bkops_info.bkops_stats);
}
if (!(host->card && mmc_card_sdio(host->card)))