[PATCH 3/7] UBI: Fastmap: Fix memory leak in error path

From: Richard Weinberger
Date: Mon Jul 09 2012 - 08:20:35 EST


Signed-off-by: Richard Weinberger <richard@xxxxxx>
---
drivers/mtd/ubi/attach.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 02505ff..5d61ba7 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1448,7 +1448,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)

err = scan_all(ubi, scan_ai, 0);
if (err) {
- kfree(scan_ai);
+ destroy_ai(scan_ai);
goto out_wl;
}

--
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/