jffs2: fix another potential leak on error path in scan.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jun 22 20:59:02 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4839641333d4593bfc4fb29aa3af10d36f607d5b
Commit:     4839641333d4593bfc4fb29aa3af10d36f607d5b
Parent:     ac1b7c378ef26fba6694d5f118fe7fc16fee2fe2
Author:     David Woodhouse <David.Woodhouse at intel.com>
AuthorDate: Tue Jun 23 01:34:19 2009 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Tue Jun 23 01:34:19 2009 +0100

    jffs2: fix another potential leak on error path in scan.c
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 fs/jffs2/scan.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 7515e73..696686c 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -130,9 +130,9 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
 	if (jffs2_sum_active()) {
 		s = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
 		if (!s) {
-			kfree(flashbuf);
 			JFFS2_WARNING("Can't allocate memory for summary\n");
-			return -ENOMEM;
+			ret = -ENOMEM;
+			goto out;
 		}
 	}
 



More information about the linux-mtd-cvs mailing list