jffs2: leaking jffs2_summary in function jffs2_scan_medium
authorChristian Engelmayer <christian.engelmayer@frequentis.com>
Sat, 13 Jun 2009 21:06:29 +0000 (23:06 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 15 Jun 2009 10:17:46 +0000 (11:17 +0100)
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>
fs/jffs2/scan.c

index 1d437de..7515e73 100644 (file)
@@ -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;