mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Geyslan G. Bem" <geyslan@gmail.com>
To: geyslan@gmail.com
Cc: Viresh Kumar <viresh.linux@gmail.com>,
	Chris Ball <cjb@laptop.org>,
	spear-devel@list.st.com (open list:SECURE DIGITAL HO...),
	linux-mmc@vger.kernel.org (open list:SECURE DIGITAL HO...),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] mmc: sdhci-spear: fix possible null dereference
Date: Sun, 17 Nov 2013 15:20:19 -0300	[thread overview]
Message-ID: <1384712421-10632-1-git-send-email-geyslan@gmail.com> (raw)

Put the 'pdata->card_int_gpio' assignment in inner scope, avoiding
explicit null dereference.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 drivers/mmc/host/sdhci-spear.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 2dba9f8..c6e5d16 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -88,10 +88,9 @@ static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pde
 			dev_err(&pdev->dev, "DT: kzalloc failed\n");
 			return ERR_PTR(-ENOMEM);
 		}
+		pdata->card_int_gpio = cd_gpio;
 	}
 
-	pdata->card_int_gpio = cd_gpio;
-
 	return pdata;
 }
 #else
-- 
1.8.4.2


             reply	other threads:[~2013-11-17 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17 18:20 Geyslan G. Bem [this message]
2013-11-18  4:23 ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384712421-10632-1-git-send-email-geyslan@gmail.com \
    --to=geyslan@gmail.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    --cc=viresh.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®