[PATCH] fix nand_fill_oob

Vitaly Wool vwool at ru.mvista.com
Wed Jun 7 06:54:37 EDT 2006


Folks,

inlined is the fix to nand_fill_oob function which prevents it from writing garbage to OOB buffer when ops->len < ops->ooblen.

Signed-off-by: Vitaly Wool <vwool at ru.mvista.com>

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 77406fc..203693b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1400,7 +1510,7 @@ static int nand_write_page(struct mtd_in
 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
 				  struct mtd_oob_ops *ops)
 {
-	size_t len = ops->ooblen;
+	size_t len = ops->len;
 
 	switch(ops->mode) {
 




More information about the linux-mtd mailing list