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