From: Atsushi Nemoto Date: Wed, 11 Feb 2009 21:12:17 +0000 (-0800) Subject: [MTD] [MAPS] physmap: fix wrong free and del_mtd_{partition,device} X-Git-Tag: v2.6.29-rc7~43^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e480814f138cd5d78a8efe397756ba6b6518fdb6;p=pandora-kernel.git [MTD] [MAPS] physmap: fix wrong free and del_mtd_{partition,device} commit 176bf2e0f10ecf1d20a97db3bd5bb2e6ba0b5668 ("physmap: fix leak of memory returned by parse_mtd_partitions") deals with a memory leak and frees the pointer array of mtd_partition after the call to add_mtd_partitions(). the problem is that mtd_table[x]->name still points to the freed memory. Aldo physmap_flash_remove() should call del_mtd_partitions() or del_mtd_device() only once. Signed-off-by: Atsushi Nemoto Reported-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke Signed-off-by: Andrew Morton Signed-off-by: David Woodhouse --- Reading git-diff-tree failed