diff options
author | Wen Zhiwei <wenzhiwei@kylinos.cn> | 2021-12-29 03:38:14 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2022-02-28 13:06:20 +0100 |
commit | 4a835afd808a3dbbac44bb399a902b822dc7445c (patch) | |
tree | 8e7979779051e1f2083e78116702dafb064a8072 /drivers/mmc | |
parent | Linux 5.17-rc6 (diff) | |
download | linux-4a835afd808a3dbbac44bb399a902b822dc7445c.tar.xz linux-4a835afd808a3dbbac44bb399a902b822dc7445c.zip |
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 42bf8a2287ba..99b201921954 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3568,7 +3568,7 @@ int dw_mci_runtime_resume(struct device *dev) mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); - 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 */ |