From: Martin Michlmayr Date: Fri, 2 Feb 2007 18:14:41 +0000 (+0100) Subject: [MTD] Don't oops when the RedBoot partition table is empty X-Git-Tag: v2.6.21-rc1~66^2~20 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=678c857f3cffb076c36ce55dfa9fb570712cec12;p=linux-2.6 [MTD] Don't oops when the RedBoot partition table is empty This fixes a regression with the RedBoot parsing code introduced by commit 0b47d654089c5ce3f2ea26a4485db9bcead1e515 Signed-off-by: Martin Michlmayr Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index 035cd9b0cc..5a31f49036 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c @@ -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); }