From: David Woodhouse Date: Tue, 23 Jun 2009 00:34:19 +0000 (+0100) Subject: jffs2: fix another potential leak on error path in scan.c X-Git-Tag: firefly_0821_release~13515^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4839641333d4593bfc4fb29aa3af10d36f607d5b;p=firefly-linux-kernel-4.4.55.git jffs2: fix another potential leak on error path in scan.c Signed-off-by: David Woodhouse --- diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 7515e73e2bfb..696686cc206e 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; } }