Oops parsing empty RedBoot partition with 2.6.20-rc7

Martin Michlmayr tbm at cyrius.com
Fri Feb 2 13:14:41 EST 2007


* Martin Michlmayr <tbm at cyrius.com> [2007-02-02 18:57]:
> It was caused by:
> 
>     [MTD] redboot partition combined fis / config problem

And this fixes it for me:

[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 <tbm at cyrius.com>

--- 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);
 		}

-- 
Martin Michlmayr
http://www.cyrius.com/




More information about the linux-mtd mailing list