aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Dooks <ben@simtec.co.uk>2005-07-06 21:05:10 +0100
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-07-06 22:26:05 +0200
commitfb8d82a865b1ff601fad8293cd6a2a1b1908545b (patch)
tree17e1504b69f4df639b970585d2962b643f507b7b /drivers
parentb3539219c9ea20ebf6a5ea3cc534f423a3607c41 (diff)
downloadmrst-s0i3-test-fb8d82a865b1ff601fad8293cd6a2a1b1908545b.tar.gz
mrst-s0i3-test-fb8d82a865b1ff601fad8293cd6a2a1b1908545b.tar.xz
mrst-s0i3-test-fb8d82a865b1ff601fad8293cd6a2a1b1908545b.zip
[MTD] NAND s3c2410: Add missing NULL pointer check
Fix OOPs if there was no platform set information passed Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/s3c2410.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 630a9c0edf3..891e3a1b911 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -16,8 +16,9 @@
* 02-May-2005 BJD Fixed s3c2440 support
* 02-May-2005 BJD Reduced hwcontrol decode
* 20-Jun-2005 BJD Updated s3c2440 support, fixed timing bug
+ * 08-Jul-2005 BJD Fix OOPS when no platform data supplied
*
- * $Id: s3c2410.c,v 1.13 2005/06/20 11:48:21 bjd Exp $
+ * $Id: s3c2410.c,v 1.14 2005/07/06 20:05:06 bjd Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -232,7 +233,7 @@ static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip)
if (chip == -1) {
cur |= bit;
} else {
- if (chip > nmtd->set->nr_chips) {
+ if (nmtd->set != NULL && chip > nmtd->set->nr_chips) {
printk(KERN_ERR PFX "chip %d out of range\n", chip);
return;
}