aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wippich <pewi@gw-instruments.de>2011-06-06 15:50:58 +0200
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-08-17 15:35:52 -0400
commitc6817c1778ce37b9bb5a65881675f4cae17312f8 (patch)
treed994b50858432a7bdd9f96663b8d8fbe25330d62
parentb1a940b43437105b60f117555289558ea4d18d4d (diff)
mtd: mtdchar: add missing initializer on raw write
commit bf5140817b2d65faac9b32fc9057a097044ac35b upstream. On writes in MODE_RAW the mtd_oob_ops struct is not sufficiently initialized which may cause nandwrite to fail. With this patch it is possible to write raw nand/oob data without additional ECC (either for testing or when some sectors need different oob layout e.g. bootloader) like nandwrite -n -r -o /dev/mtd0 <myfile> Signed-off-by: Peter Wippich <pewi@gw-instruments.de> Tested-by: Ricard Wanderlof <ricardw@axis.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--drivers/mtd/mtdchar.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5b081cb8435..726a1b8d29d 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -290,6 +290,7 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
ops.mode = MTD_OOB_RAW;
ops.datbuf = kbuf;
ops.oobbuf = NULL;
+ ops.ooboffs = 0;
ops.len = len;
ret = mtd->write_oob(mtd, *ppos, &ops);