From patchwork Tue Feb 4 12:28:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 3575771 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FE94C02DC for ; Tue, 4 Feb 2014 12:26:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D262620166 for ; Tue, 4 Feb 2014 12:26:54 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by mail.kernel.org (Postfix) with ESMTP id BC6D820163 for ; Tue, 4 Feb 2014 12:26:53 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 90B7C7FE; Tue, 4 Feb 2014 12:26:53 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTP id 67E647FE for ; Tue, 4 Feb 2014 12:26:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 8F1D41F895 for ; Tue, 4 Feb 2014 12:26:51 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 04 Feb 2014 04:22:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,779,1384329600"; d="scan'208";a="477773571" Received: from ahunter-desktop.fi.intel.com ([10.237.72.194]) by orsmga002.jf.intel.com with ESMTP; 04 Feb 2014 04:26:50 -0800 From: Adrian Hunter To: ltsi-dev Date: Tue, 4 Feb 2014 14:28:54 +0200 Message-Id: <1391516934-13561-1-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.7.11.7 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Subject: [LTSI-dev] [PATCH LTSI 3.10] mmc: sdhci-pci: Fix possibility of chip->fixes being null X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP It is possible for chip->fixes to be null. Check before dereferencing it. Signed-off-by: Adrian Hunter Signed-off-by: Chris Ball (cherry picked from commit 945be38caa287b177b8c17ffaae7754cab6a658f) Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci-pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 33593e7..27ae563 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -1389,7 +1389,8 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( * from runtime suspend. If it is not there, don't allow runtime PM. * Note sdhci_pci_add_own_cd() sets slot->cd_gpio to -EINVAL on failure. */ - if (chip->fixes->own_cd_for_runtime_pm && !gpio_is_valid(slot->cd_gpio)) + if (chip->fixes && chip->fixes->own_cd_for_runtime_pm && + !gpio_is_valid(slot->cd_gpio)) chip->allow_runtime_pm = false; return slot;