9
0
Fork 0

mtd: nand-bb: Fix test for bad block when reading

in nand_bb_read() 'offset' contains the virtual position on the device,
but we have to test for a bad block on the raw physical position, so
use bb->offset instead of offset

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2015-02-10 09:52:04 +01:00
parent eebfbe9116
commit ce073eb9e4
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ static ssize_t nand_bb_read(struct cdev *cdev, void *buf, size_t count,
if (max <= 0)
break;
if (mtd_block_isbad(bb->mtd, offset)) {
if (mtd_block_isbad(bb->mtd, bb->offset)) {
printf("skipping bad block at 0x%08llx\n", bb->offset);
bb->offset += bb->mtd->erasesize;
continue;