Commit 3acdddcb authored by Roel Kluin's avatar Roel Kluin Committed by James Toy

If the erase region was found in the first iteration we read from

regions[-1]
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7c65eb09
...@@ -453,7 +453,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master, ...@@ -453,7 +453,8 @@ static struct mtd_part *add_one_partition(struct mtd_info *master,
for (i = 0; i < max && regions[i].offset <= slave->offset; i++) for (i = 0; i < max && regions[i].offset <= slave->offset; i++)
; ;
/* The loop searched for the region _behind_ the first one */ /* The loop searched for the region _behind_ the first one */
i--; if (i > 0)
i--;
/* Pick biggest erasesize */ /* Pick biggest erasesize */
for (; i < max && regions[i].offset < end; i++) { for (; i < max && regions[i].offset < end; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment