[ifxmips] Fix accessing array after it end.
[openwrt.git] / target / linux / ifxmips / files / drivers / mtd / maps / ifxmips.c
index aed241b..a2d30cd 100644 (file)
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/cfi.h>
+#include <linux/magic.h>
+#include <linux/platform_device.h>
+
 #include <asm/ifxmips/ifxmips.h>
 #include <asm/ifxmips/ifxmips_prom.h>
 #include <asm/ifxmips/ifxmips_ebu.h>
 #include <asm/ifxmips/ifxmips.h>
 #include <asm/ifxmips/ifxmips_prom.h>
 #include <asm/ifxmips/ifxmips_ebu.h>
-#include <linux/magic.h>
-#include <linux/platform_device.h>
 
 #ifndef CONFIG_MTD_PARTITIONS
 #error Please enable CONFIG_MTD_PARTITIONS
 
 #ifndef CONFIG_MTD_PARTITIONS
 #error Please enable CONFIG_MTD_PARTITIONS
@@ -231,9 +232,9 @@ static int ifxmips_mtd_probe(struct platform_device *dev)
 
        if (err <= 0) {
                if (ifxmips_has_brn_block()) {
 
        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--;
                }
                } else {
                        num_parts--;
                }
This page took 0.021161 seconds and 4 git commands to generate.