aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorJon Povey <jon.povey@racelogic.co.uk>2010-09-30 07:41:34 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-10-24 20:33:37 -0400
commitcdcf12b211d45bd68acae9d8189275d29d500d12 (patch)
treec5c6f7f3b7324d292144ea0b02ffdbded117f0a7 /drivers/mtd/nand
parent04aadf36de625647c72ec24c7e901896dd2a99e6 (diff)
mtd: nand: fix MTD_MODE_RAW writes
RAW writes were broken by 782ce79a45b3b850b108896fcf7da26754061c8f which introduced a check of ops->ooboffs in nand_do_write_ops(). When writing in RAW mode this is called with an ops struct on the stack of mtdchar.c:mtd_write() which does not initialise ops->ooboffs, so it is garbage and fails this test. This test does not make sense if ops->oobbuf is NULL, which it is in the RAW write path, so include that in the test. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/nand_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 53f4e41836f1..1f75a1b1f7c3 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2214,7 +2214,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
2214 memset(chip->oob_poi, 0xff, mtd->oobsize); 2214 memset(chip->oob_poi, 0xff, mtd->oobsize);
2215 2215
2216 /* Don't allow multipage oob writes with offset */ 2216 /* Don't allow multipage oob writes with offset */
2217 if (ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen)) 2217 if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen))
2218 return -EINVAL; 2218 return -EINVAL;
2219 2219
2220 while (1) { 2220 while (1) {