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:
parent
bcb87d5a2a
commit
11f2e46a4a
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue