From patchwork Sat Jun 25 21:57:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Corallo X-Patchwork-Id: 640641 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rclqX72pPz9sD5 for ; Sun, 26 Jun 2016 18:39:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 172C9A7532; Sun, 26 Jun 2016 10:39:34 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nQnDMvYdgGRc; Sun, 26 Jun 2016 10:39:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16C7BA74DA; Sun, 26 Jun 2016 10:39:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE1BAA74DA for ; Sun, 26 Jun 2016 00:04:06 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7doBrOCHJlxZ for ; Sun, 26 Jun 2016 00:04:06 +0200 (CEST) X-Greylist: delayed 415 seconds by postgrey-1.34 at theia; Sun, 26 Jun 2016 00:04:02 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.bluematt.me (mail.bluematt.me [192.241.179.72]) by theia.denx.de (Postfix) with ESMTPS id 627E8A74D6 for ; Sun, 26 Jun 2016 00:04:02 +0200 (CEST) Received: from [172.17.0.2] (gw.vpn.bluematt.me [162.243.132.6]) by mail.bluematt.me (Postfix) with ESMTPSA id 6925A4BCD8; Sat, 25 Jun 2016 21:57:05 +0000 (UTC) To: u-boot@lists.denx.de From: Matt Corallo Message-ID: <576EFE30.4060501@bluematt.me> Date: Sat, 25 Jun 2016 21:57:04 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jun 2016 10:39:30 +0200 Cc: Pantelis Antoniou Subject: [U-Boot] [PATCH] MMC: Do not write to mmc_uclass_priv if it was not allocated X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Matt Corallo --- drivers/mmc/mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index aabfc71..eba20f0 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1734,7 +1734,8 @@ int mmc_init(struct mmc *mmc) #ifdef CONFIG_DM_MMC struct mmc_uclass_priv *upriv = dev_get_uclass_priv(mmc->dev); - upriv->mmc = mmc; + if (upriv) + upriv->mmc = mmc; #endif if (mmc->has_init) return 0;