浏览代码

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

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
David Woodhouse 16 年之前
父节点
当前提交
4839641333
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      fs/jffs2/scan.c

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