提交 a2ab0ce0 编写于 作者: C Christian Engelmayer 提交者: David Woodhouse

jffs2: leaking jffs2_summary in function jffs2_scan_medium

In case of an error returned by file_dirty() 's' is not freed as the cleanup
path is skipped.

Reported by Coverity.
Signed-off-by: NChristian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 272023df
......@@ -196,7 +196,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
if (c->nextblock) {
ret = file_dirty(c, c->nextblock);
if (ret)
return ret;
goto out;
/* deleting summary information of the old nextblock */
jffs2_sum_reset_collected(c->summary);
}
......@@ -207,7 +207,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
} else {
ret = file_dirty(c, jeb);
if (ret)
return ret;
goto out;
}
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册