From patchwork Mon Jun 20 04:16:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9186559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 269B06075F for ; Mon, 20 Jun 2016 04:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13F99223A6 for ; Mon, 20 Jun 2016 04:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0864223B24; Mon, 20 Jun 2016 04:17:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E1D922BF1 for ; Mon, 20 Jun 2016 04:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbcFTERC (ORCPT ); Mon, 20 Jun 2016 00:17:02 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:51160 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbcFTERC (ORCPT ); Mon, 20 Jun 2016 00:17:02 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O91001EDYIZIYC0@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 20 Jun 2016 13:16:11 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 62.EF.05160.B0E67675; Mon, 20 Jun 2016 13:16:11 +0900 (KST) X-AuditID: cbfee68e-f79266d000001428-72-57676e0b8e73 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id C7.1E.04429.B0E67675; Sun, 19 Jun 2016 21:16:11 -0700 (MST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O91004COYIZAK70@mmp1.samsung.com>; Mon, 20 Jun 2016 13:16:11 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH] mmc: dw_mmc: exynos: fix the NULL pointer dereference error Date: Mon, 20 Jun 2016 13:16:09 +0900 Message-id: <1466396169-26703-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsWyRsSkUJc7Lz3c4Ps6fYsbv9pYLY7872e0 uPNkPavF8bXhDiwed67tYfP4O2s/i0ffllWMHp83yQWwRHHZpKTmZJalFunbJXBlnNjaz17w ga3i2sJGlgbGJ6xdjJwcEgImEq2H5rFA2GISF+6tZ+ti5OIQEljBKDFvxg8WmKIP7xYwQiSW Mkr83LmJHcL5wShx+vERdpAqNgEdie3fjjOB2CICshI//1xgA7GZBeIkFh39CVYjLOAj8XjG XrAaFgFViY6maWBxXgE3ic9HNzBBbJOTOHlsMivIAgmBx2wSn+dPZ4doEJD4NvkQ0EkcQAlZ iU0HmCHqJSUOrrjBMoFRcAEjwypG0dSC5ILipPQiI73ixNzi0rx0veT83E2MwHA8/e9Z3w7G mwesDzEKcDAq8fBanE0LF2JNLCuuzD3EaAq0YSKzlGhyPjDo80riDY3NjCxMTU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1GIuKk4EAACAQSSPAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "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 --- drivers/mmc/host/dw_mmc-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }