mtd/drivers/mtd/nand nand_base.c,1.151,1.152

tpoynor at infradead.org tpoynor at infradead.org
Fri Nov 4 22:21:15 EST 2005


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv1209/drivers/mtd/nand

Modified Files:
	nand_base.c 
Log Message:
[MTD] NAND: nand_write_ecc memory and OOB corruption

Nathan Roberts noticed the nand_write_ecc index into oobbuf goes out of
bounds when crossing an erase block boundary, causing incorrect OOB data
to be written and corrupting memory.  Reset the index to zero after
re-preparing oobbuf for a new erase block.

Signed-off-by: Todd Poynor <tpoynor at mvista.com>


Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- nand_base.c	2 Nov 2005 16:54:42 -0000	1.151
+++ nand_base.c	5 Nov 2005 03:21:11 -0000	1.152
@@ -1958,6 +1958,7 @@
 			startpage = page;
 			oobbuf = nand_prepare_oobbuf (mtd, eccbuf, oobsel, 
 					autoplace, numpages);
+			oob = 0;
 			/* Check, if we cross a chip boundary */
 			if (!page) {
 				chipnr++;





More information about the linux-mtd-cvs mailing list