Missing offset increment in scan_read_raw_oob()

Dmitry Maluka D.Maluka at adbglobal.com
Fri May 11 13:51:51 EDT 2012


It seems there is a bug in scan_read_raw_oob() in nand_bbt.c which
should cause wrong functioning of NAND_BBT_SCANALLPAGES option.

Possible fix (relies on offs passed page-aligned):

--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -324,6 +324,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd,
uint8_t *buf, loff_t offs,
 
                buf += mtd->oobsize + mtd->writesize;
                len -= mtd->writesize;
+               offs += mtd->writesize;
        }
        return 0;
 }



More information about the linux-mtd mailing list