1 --- a/drivers/mtd/parsers/redboot.c
2 +++ b/drivers/mtd/parsers/redboot.c
3 @@ -94,12 +94,18 @@ static int parse_redboot_partitions(stru
5 parse_redboot_of(master);
7 + buf = vmalloc(master->erasesize);
13 offset = master->size + directory * master->erasesize;
14 while (mtd_block_isbad(master, offset)) {
17 pr_notice("Failed to find a non-bad block to check for RedBoot partition table\n");
21 offset -= master->erasesize;
22 @@ -112,10 +118,6 @@ nogood:
26 - buf = vmalloc(master->erasesize);
31 pr_notice("Searching for RedBoot partition table in %s at offset 0x%lx\n",
32 master->name, offset);
33 @@ -187,6 +189,11 @@ nogood:
37 + if (offset + master->erasesize < master->size) {
38 + /* not at the end of the flash yet, maybe next block */
42 pr_notice("No RedBoot partition table detected in %s\n",