diff options
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 3d7ed432fa4..8c21b89d2d0 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -2756,7 +2756,8 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
2756 | * the out of band area | 2756 | * the out of band area |
2757 | */ | 2757 | */ |
2758 | chip->ecc.layout->oobavail = 0; | 2758 | chip->ecc.layout->oobavail = 0; |
2759 | for (i = 0; chip->ecc.layout->oobfree[i].length; i++) | 2759 | for (i = 0; chip->ecc.layout->oobfree[i].length |
2760 | && i < ARRAY_SIZE(chip->ecc.layout->oobfree); i++) | ||
2760 | chip->ecc.layout->oobavail += | 2761 | chip->ecc.layout->oobavail += |
2761 | chip->ecc.layout->oobfree[i].length; | 2762 | chip->ecc.layout->oobfree[i].length; |
2762 | mtd->oobavail = chip->ecc.layout->oobavail; | 2763 | mtd->oobavail = chip->ecc.layout->oobavail; |