X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fmtd%2Fnand%2Fnand_base.c;h=8c21b89d2d0c2a7ea79eccf0d9c840771c68a58a;hb=81d19b04a865f9fcc0ca01b20be806169ff9efb3;hp=3d7ed432fa4157ec9d655c3354c4c1edc699ebc8;hpb=8e2c4f2844c0e8dcdfe312e5f2204854ca8532c6;p=karo-tx-linux.git diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 3d7ed432fa41..8c21b89d2d0c 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) * the out of band area */ chip->ecc.layout->oobavail = 0; - for (i = 0; chip->ecc.layout->oobfree[i].length; i++) + for (i = 0; chip->ecc.layout->oobfree[i].length + && i < ARRAY_SIZE(chip->ecc.layout->oobfree); i++) chip->ecc.layout->oobavail += chip->ecc.layout->oobfree[i].length; mtd->oobavail = chip->ecc.layout->oobavail;