UPSTREAM: mmc: dw_mmc: Fix potential null pointer risk

we previously assumed 'host->slot' could be null,
null pointer judgment should be added

Signed-off-by: Wen Zhiwei <wenzhiwei@kylinos.cn>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Link: https://lore.kernel.org/r/20211229023814.53372-1-wenzhiwei@kylinos.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
(cherry picked from commit 4a835afd80)
Change-Id: Iffade4e1d3ab6ad5bde7b6f05aaf3ce03ba28922
This commit is contained in:
Wen Zhiwei
2021-12-29 10:38:14 +08:00
committed by Tao Huang
parent 16239e4037
commit d85f16835d
+1 -1
View File
@@ -3670,7 +3670,7 @@ int dw_mci_runtime_resume(struct device *dev)
mci_writel(host, INTMASK, ret);
}
if (host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
if (host->slot && host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER)
dw_mci_set_ios(host->slot->mmc, &host->slot->mmc->ios);
/* Force setup bus to guarantee available clock output */