Skip to content

Commit

Permalink
jffs2: leaking jffs2_summary in function jffs2_scan_medium
Browse files Browse the repository at this point in the history
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: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Christian Engelmayer authored and David Woodhouse committed Jun 15, 2009
1 parent 272023d commit a2ab0ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;

Expand Down

0 comments on commit a2ab0ce

Please sign in to comment.