|
@@ -2871,7 +2871,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;
|