]> err.no Git - linux-2.6/commitdiff
[MTD] Don't oops when the RedBoot partition table is empty
authorMartin Michlmayr <tbm@cyrius.com>
Fri, 2 Feb 2007 18:14:41 +0000 (19:14 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 9 Feb 2007 15:06:53 +0000 (15:06 +0000)
This fixes a regression with the RedBoot parsing code introduced by
commit 0b47d654089c5ce3f2ea26a4485db9bcead1e515

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/redboot.c

index 035cd9b0cc08b327f83d8f12958eacdcab7f6c94..5a31f490368ebb1977397a7510f9032543d972cd 100644 (file)
@@ -122,7 +122,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
                                }
                        }
                        break;
-               } else {
+               } else if (buf[i].size != -1) {
                        /* re-calculate of real numslots */
                        numslots = buf[i].size / sizeof(struct fis_image_desc);
                }