Skip to content
Commit e480814f authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by David Woodhouse
Browse files

[MTD] [MAPS] physmap: fix wrong free and del_mtd_{partition,device}

commit 176bf2e0

 ("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: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Reported-by: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Tested-by: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 3afd522d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment