mtd: Fix compile failure and error path in physmap.c
commit8ce110ac19bc88b82e3feacfbb3a2ee08a07fe22
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 20 Oct 2009 16:23:33 +0000 (20 12:23 -0400)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 20 Oct 2009 21:29:27 +0000 (21 06:29 +0900)
tree942c3de936655fb78a9e356a4cea6b056687c7da
parent1cc523999e0acd0c21f83bf89b7a44b4ab6f7bd8
mtd: Fix compile failure and error path in physmap.c

Commit 4b56ffcacee937a85bf39e14872dd141e23ee85f ("mtd: Fix kernel NULL
pointer dereference in physmap.c") introduced a couple of bugs.

It neglected to run the loop of map_destroy() calls in
physmap_flash_remove(), if !info->cmtd, which would happen if that
function was called to clean up errors during probe.

It also failed to compile if CONFIG_MTD_PARTITIONS was not defined.

Reported-By: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/physmap.c