1 --- a/drivers/mtd/bcm47xxpart.c
2 +++ b/drivers/mtd/bcm47xxpart.c
4 #include <linux/mtd/mtd.h>
5 #include <linux/mtd/partitions.h>
7 -/* 10 parts were found on sflash on Netgear WNDR4500 */
8 -#define BCM47XXPART_MAX_PARTS 12
10 + * NAND flash on Netgear R6250 was verified to contain 15 partitions.
11 + * This will result in allocating too big array for some old devices, but the
12 + * memory will be freed soon anyway (see mtd_device_parse_register).
14 +#define BCM47XXPART_MAX_PARTS 20
17 * Amount of bytes we read when analyzing each block of flash memory.
18 @@ -168,18 +172,26 @@ static int bcm47xxpart_parse(struct mtd_
22 - bcm47xxpart_add_part(&parts[curr_part++], "linux",
23 - offset + trx->offset[i], 0);
25 + if (trx->offset[i]) {
26 + bcm47xxpart_add_part(&parts[curr_part++],
28 + offset + trx->offset[i],
34 * Pure rootfs size is known and can be calculated as:
35 * trx->length - trx->offset[i]. We don't fill it as
36 * we want to have jffs2 (overlay) in the same mtd.
38 - bcm47xxpart_add_part(&parts[curr_part++], "rootfs",
39 - offset + trx->offset[i], 0);
41 + if (trx->offset[i]) {
42 + bcm47xxpart_add_part(&parts[curr_part++],
44 + offset + trx->offset[i],
49 last_trx_part = curr_part - 1;