mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk,
	nico@fluxnic.net, kernel@wantstofly.org, kernel@pengutronix.de,
	u.kleine-koenig@pengutronix.de, kaloz@openwrt.org, khc@pm.waw.pl,
	tj@kernel.org, gregkh@suse.de, stable-review@kernel.org,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Artem.Bityutskiy@nokia.com,
	David.Woodhouse@intel.com, ralf@linux-mips.org,
	vapier@gentoo.org, michael.hennerich@analog.com,
	barry.song@analog.com, sonic.zhang@analog.com,
	cliff.cai@analog.com, uclinux-dist-devel@blackfin.uclinux.org,
	yakovenkov@gmail.com, w.sang@pengutronix.de,
	Marek Vasut <marek.vasut@gmail.com>
Subject: [PATCH 2/2] gen_nand: Test if nr_chips field is valid
Date: Thu, 12 Aug 2010 04:53:55 +0200	[thread overview]
Message-ID: <1281581635-26213-2-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1281581635-26213-1-git-send-email-marek.vasut@gmail.com>

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/mtd/nand/plat_nand.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 90e143e..317aff4 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -37,6 +37,11 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
 	struct resource *res;
 	int err = 0;
 
+	if (pdata->chip.nr_chips < 1) {
+		dev_err(&pdev->dev, "invalid number of chips specified\n");
+		return -EINVAL;
+	}
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
 		return -ENXIO;
-- 
1.7.1


  reply	other threads:[~2010-08-12  2:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12  2:53 [PATCH 1/2 v2] ARM: Fix gen_nand probe structures contents Marek Vasut
2010-08-12  2:53 ` Marek Vasut [this message]
2010-08-12  2:57 ` Marek Vasut
2010-08-12  3:37   ` Mike Frysinger
2010-08-12  3:36 ` Mike Frysinger
2010-08-12 11:04   ` Marek Vasut
2010-08-12 12:47     ` Mike Frysinger
2010-08-12 13:48       ` Marek Vasut

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=1281581635-26213-2-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=David.Woodhouse@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=barry.song@analog.com \
    --cc=cliff.cai@analog.com \
    --cc=gregkh@suse.de \
    --cc=kaloz@openwrt.org \
    --cc=kernel@pengutronix.de \
    --cc=kernel@wantstofly.org \
    --cc=khc@pm.waw.pl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=michael.hennerich@analog.com \
    --cc=nico@fluxnic.net \
    --cc=ralf@linux-mips.org \
    --cc=sonic.zhang@analog.com \
    --cc=stable-review@kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.org \
    --cc=w.sang@pengutronix.de \
    --cc=yakovenkov@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

Powered by JetHome