[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1281581635-26213-2-git-send-email-marek.vasut@gmail.com>
Date: Thu, 12 Aug 2010 04:53:55 +0200
From: Marek Vasut <marek.vasut@...il.com>
To: linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, linux@....linux.org.uk,
nico@...xnic.net, kernel@...tstofly.org, kernel@...gutronix.de,
u.kleine-koenig@...gutronix.de, kaloz@...nwrt.org, khc@...waw.pl,
tj@...nel.org, gregkh@...e.de, stable-review@...nel.org,
torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
alan@...rguk.ukuu.org.uk, Artem.Bityutskiy@...ia.com,
David.Woodhouse@...el.com, ralf@...ux-mips.org, vapier@...too.org,
michael.hennerich@...log.com, barry.song@...log.com,
sonic.zhang@...log.com, cliff.cai@...log.com,
uclinux-dist-devel@...ckfin.uclinux.org, yakovenkov@...il.com,
w.sang@...gutronix.de, Marek Vasut <marek.vasut@...il.com>
Subject: [PATCH 2/2] gen_nand: Test if nr_chips field is valid
Signed-off-by: Marek Vasut <marek.vasut@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists