]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: dw_mmc: exynos: fix the NULL pointer dereference error
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 20 Jun 2016 04:16:09 +0000 (13:16 +0900)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 25 Jul 2016 08:34:29 +0000 (10:34 +0200)
"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 <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-exynos.c

index 7e3a3247b852d76f8521d93cdf5d9d6cef73ccba..da0ef1765735fe48a69a5faf72236598ce1a5cf2 100644 (file)
@@ -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);
 }