diff options
-rw-r--r-- | drivers/mtd/mtdpart.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 349fcbe5cc0f..a83cfa1ad122 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -453,7 +453,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master, | |||
453 | for (i = 0; i < max && regions[i].offset <= slave->offset; i++) | 453 | for (i = 0; i < max && regions[i].offset <= slave->offset; i++) |
454 | ; | 454 | ; |
455 | /* The loop searched for the region _behind_ the first one */ | 455 | /* The loop searched for the region _behind_ the first one */ |
456 | i--; | 456 | if (i > 0) |
457 | i--; | ||
457 | 458 | ||
458 | /* Pick biggest erasesize */ | 459 | /* Pick biggest erasesize */ |
459 | for (; i < max && regions[i].offset < end; i++) { | 460 | for (; i < max && regions[i].offset < end; i++) { |