mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
mtd: mtdchar: add missing initializer on raw write
commit bf5140817b 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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
041f9e20b7
commit
5805ad8491
|
|
@ -320,6 +320,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user