Fix accessing array after it end.
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 2 Jun 2009 20:10:29 +0000 (20:10 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 2 Jun 2009 20:10:29 +0000 (20:10 +0000)
SVN-Revision: 16301

target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c

index b4faf0535634b70601b5cf71542877492f9f8666..a2d30cd0b6deb60064c12e4bb30ecaa2558d06e4 100644 (file)
@@ -232,9 +232,9 @@ static int ifxmips_mtd_probe(struct platform_device *dev)
 
        if (err <= 0) {
                if (ifxmips_has_brn_block()) {
-                       parts[4].size -= ifxmips_mtd->erasesize;
-                       parts[5].offset = ifxmips_mtd->size - ifxmips_mtd->erasesize;
-                       parts[5].size = ifxmips_mtd->erasesize;
+                       parts[3].size -= ifxmips_mtd->erasesize;
+                       parts[4].offset = ifxmips_mtd->size - ifxmips_mtd->erasesize;
+                       parts[4].size = ifxmips_mtd->erasesize;
                } else {
                        num_parts--;
                }