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

login
register
mail settings
Submitter Richard Weinberger
Date July 9, 2012, 12:18 p.m.
Message ID <1341836323-43916-4-git-send-email-richard@nod.at>
Download mbox | patch
Permalink /patch/169806/
State New
Headers show

Comments

Richard Weinberger - July 9, 2012, 12:18 p.m.
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/attach.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

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;
 		}