mtd: mtdpart: fix add_mtd_partitions error path
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Thu, 30 Jul 2015 10:18:03 +0000 (12:18 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 30 Sep 2015 16:49:07 +0000 (09:49 -0700)
commite5bae86797141e4a95e42d825f737cb36d7b8c37
treef07430dbc26281a376259e8f410d1b4463b88615
parentd489ff42db9179647004ca2b12c614cb71ac81ea
mtd: mtdpart: fix add_mtd_partitions error path

If we fail to allocate a partition structure in the middle of the partition
creation process, the already allocated partitions are never removed, which
means they are still present in the partition list and their resources are
never freed.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: stable@vger.kernel.org
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/mtdpart.c