From: Jaehoon Chung Date: Mon, 20 Jun 2016 04:16:09 +0000 (+0900) Subject: mmc: dw_mmc: exynos: fix the NULL pointer dereference error X-Git-Tag: v4.14-rc1~2757^2~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5a613537c4816830541046af12e8d37b075949c;p=platform%2Fkernel%2Flinux-rpi.git mmc: dw_mmc: exynos: fix the NULL pointer dereference error "host->cur_slot" should be assigned to start the request. So it can be the NULL pointer. This patch fixed this error. Signed-off-by: Jaehoon Chung Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 7e3a324..da0ef17 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -157,7 +157,7 @@ static void dw_mci_exynos_set_clksel_timing(struct dw_mci *host, u32 timing) * HOLD register should be bypassed in case there is no phase shift * applied on CMD/DATA that is sent to the card. */ - if (!SDMMC_CLKSEL_GET_DRV_WD3(clksel)) + if (!SDMMC_CLKSEL_GET_DRV_WD3(clksel) && host->cur_slot) set_bit(DW_MMC_CARD_NO_USE_HOLD, &host->cur_slot->flags); }