mtd: maps: add missing iounmap() in error path
authorLuis Henriques <henrix@camandro.org>
Wed, 23 Nov 2016 23:40:36 +0000 (23:40 +0000)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 1 Dec 2016 02:30:24 +0000 (18:30 -0800)
commit3502fbcc25eb67db96fea35abe721c82aa1f4ff3
treeb2e83f7a028bf70f05b4c2c9756a4aff562570d1
parent5fed67df878b598c3a4afdd4c09e9bea491651dd
mtd: maps: add missing iounmap() in error path

This patch was triggered by the following Coccinelle error:

./drivers/mtd/maps/sc520cdp.c:246:3-9: \
ERROR: missing iounmap; ioremap on line 242 \
and execution via conditional on line 244

Since do_map_probe() is also invoked in this loop, it is also necessary to
map_destroy() any initialised struct mtd_info.

Signed-off-by: Luis Henriques <henrix@camandro.org>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/maps/sc520cdp.c