jffs2: leaking jffs2_summary in function jffs2_scan_medium
PATCH 1/1 jffs2: leaking jffs2_summary in function jffs2_scan_medium
From: Christian Engelmayer <[email protected]>
In case of an error returned by file_dirty() 's' is not freed as the cleanup path is skipped.
Signed-off-by Christian Engelmayer <[email protected]>
--
Reported by Coverity.
fs/jffs2/scan.c renamed from fs/jffs2/scan.c.orig +2 -2
@@ -196,7 +196,7 @@ int jffs2_scan_medium(struct jffs2_sb_inif (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_in }else { ret =file_dirty (c, jeb);if (ret) -return ret; + goto out; }break ;