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

Richard Weinberger
2012-07-09T12:19:10Z

Signed-off-by: Richard Weinberger <richard@nod.at>
---
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