From patchwork Tue Jul 2 10:53:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 18231 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6DA202391D for ; Tue, 2 Jul 2013 10:53:11 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha12sf5048181vcb.8 for ; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=IWIV/5Cgu9GCYDH+IMPjHhw77fmzCHIxcdEgaPIyv3s=; b=aBekiV6/AN3kH2LnZwZTPZfUSJaV0DSm6NKjY6SiNLaYmaKVSlnU+Y1IdhKM819xla ZKIlRPjoKixdhmgXj7qlT9dekoAc1pve3ecmXOXTBedbw2dtdwAsdIpBkHWMMXsVX3x4 W5KMW7NUtyvRMDEJzjDlFSkHTYxP6RrZhe67tuKsu2SHaDv1o3BfPW5srm8tBW1KhlvS 8SnaOMeTV0laZBzIe90iJkJac5uuJesRmSayg0OsfrJRfxmXsgdbR2JLSTfYZxHNgVRW Td0PMK0QzwSteMIx06jPHGgYwUcmBsklsbgaHof/TubMtTlCh7NtSz3S6dmG6wAVNZcO LiPQ== X-Received: by 10.224.129.196 with SMTP id p4mr30394313qas.6.1372762390739; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.100 with SMTP id v4ls2623717qed.77.gmail; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) X-Received: by 10.220.143.140 with SMTP id v12mr11095218vcu.95.1372762390511; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id xz7si618753vcb.22.2013.07.02.03.53.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 03:53:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id e15so4497679vbg.17 for ; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) X-Received: by 10.52.27.172 with SMTP id u12mr9204962vdg.64.1372762390396; Tue, 02 Jul 2013 03:53:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp5152veb; Tue, 2 Jul 2013 03:53:09 -0700 (PDT) X-Received: by 10.112.16.163 with SMTP id h3mr13531006lbd.85.1372762388916; Tue, 02 Jul 2013 03:53:08 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id ex4si7534076lbc.64.2013.07.02.03.53.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 03:53:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.43 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id gw10so5418624lab.16 for ; Tue, 02 Jul 2013 03:53:08 -0700 (PDT) X-Received: by 10.112.29.17 with SMTP id f17mr13775740lbh.20.1372762388153; Tue, 02 Jul 2013 03:53:08 -0700 (PDT) Received: from steludxu1397.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id m1sm8857967lag.3.2013.07.02.03.53.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jul 2013 03:53:07 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Stephen Warren , Tuomas Tynkkynen , Jaehoon Chung , Ulf Hansson Subject: [PATCH] mmc: core: Fixup Oops for SDIO shutdown Date: Tue, 2 Jul 2013 12:53:01 +0200 Message-Id: <1372762381-18832-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.10 X-Gm-Message-State: ALoCoQl5BZfUGCQkauSNghz9KFKuHCfT3ZKuDcv1Y2E3+WlWNt/iFs+mUQCUz8L/y81yRc39tiGZ X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit "mmc: core: Handle card shutdown from mmc_bus" introduced an Oops in the shutdown sequence for SDIO. The drv pointer, does not exist for SDIO since the probing of the SDIO card from the mmc_bus perspective is expected to fail by returning -ENODEV. This patch adds the proper check for the pointer before calling it. Reported-by: Stephen Warren Reported-by: Tuomas Tynkkynen Cc: Jaehoon Chung Signed-off-by: Ulf Hansson --- drivers/mmc/core/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 4c0decf..d4b99bb 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -129,7 +129,8 @@ static void mmc_bus_shutdown(struct device *dev) struct mmc_host *host = card->host; int ret; - drv->shutdown(card); + if (dev->driver && drv->shutdown) + drv->shutdown(card); if (host->bus_ops->shutdown) { ret = host->bus_ops->shutdown(host);