%patch Index: linux-2.6-bk/drivers/mtd/redboot.c =================================================================== --- linux-2.6-bk.orig/drivers/mtd/redboot.c 2004-07-19 09:35:43.000000000 +0100 +++ linux-2.6-bk/drivers/mtd/redboot.c 2004-07-19 10:27:23.169539161 +0100 @@ -49,6 +49,7 @@ char *nullname; int namelen = 0; int nulllen = 0; + unsigned long offset; #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED static char nullstring[] = "unallocated"; #endif @@ -59,7 +60,9 @@ return -ENOMEM; /* Read the start of the last erase block */ - ret = master->read(master, master->size - master->erasesize, + offset = master->size - master->erasesize; + + ret = master->read(master, offset, master->erasesize, &retlen, (void *)buf); if (ret) @@ -72,7 +75,7 @@ /* RedBoot image could appear in any of the first three slots */ for (i = 0; i < 3; i++) { - if (!memcmp(buf[i].name, "RedBoot", 8)) + if (!memcmp(buf[i].name, "RedBoot", 7)) break; } if (i == 3) {