android_kernel_google_msm/drivers/mtd
Huang Shijie e82df24e73 mtd: mtdpart: break it as soon as we parse out the partitions
commit c51803ddba upstream.

We may cause a memory leak when the @types has more then one parser.

Take the `default_mtd_part_types` for example. The default_mtd_part_types has
two parsers now: `cmdlinepart` and `ofpart`.

Assume the following case:
The kernel command line sets the partitions like:
	#gpmi-nand:20m(boot),20m(kernel),1g(rootfs),-(user)
But the devicetree file(such as arch/arm/boot/dts/imx28-evk.dts) also sets
the same partitions as the kernel command line does.

In the current code, the partitions parsed out by the `ofpart` will
overwrite the @pparts which has already set by the `cmdlinepart` parser,
and the the partitions parsed out by the `cmdlinepart` is missed.
A memory leak occurs.

So we should break the code as soon as we parse out the partitions,
In actually, this patch makes a priority order between the parsers.
If one parser has already parsed out the partitions successfully,
it's no need to use another parser anymore.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-13 05:38:58 +09:00
..
chips MTD merge for 3.4 2012-03-30 17:31:56 -07:00
devices mtd: block2mtd: fix recursive call of mtd_writev 2012-06-10 00:36:13 +09:00
lpddr
maps MTD merge for 3.4 2012-03-30 17:31:56 -07:00
nand mtd: nandsim: don't open code a do_div helper 2012-07-19 08:58:55 -07:00
onenand MTD merge for 3.4 2012-03-30 17:31:56 -07:00
tests
ubi UBI: fix autoresize handling in R/O mode 2012-10-07 08:32:28 -07:00
afs.c
ar7part.c
bcm63xxpart.c
cmdlinepart.c
ftl.c
inftlcore.c
inftlmount.c
Kconfig mtd: of_parts: fix breakage in Kconfig 2012-06-10 00:36:13 +09:00
Makefile
mtd_blkdevs.c
mtdblock.c
mtdblock_ro.c
mtdchar.c mtd: fix oops in dataflash driver 2012-05-07 20:29:50 +01:00
mtdconcat.c mtd: unify initialization of erase_info->fail_addr 2012-03-27 01:02:24 +01:00
mtdcore.c mtd: unify initialization of erase_info->fail_addr 2012-03-27 01:02:24 +01:00
mtdcore.h
mtdoops.c
mtdpart.c mtd: mtdpart: break it as soon as we parse out the partitions 2012-10-13 05:38:58 +09:00
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c
redboot.c
rfd_ftl.c
sm_ftl.c mtd: sm_ftl: fix typo in major number. 2012-03-27 01:01:26 +01:00
sm_ftl.h
ssfdc.c