jffs2: leaking jffs2_summary in function jffs2_scan_medium

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jun 15 10:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a2ab0ce09edf20b5228208405dd14bc8790fbdbd
Commit:     a2ab0ce09edf20b5228208405dd14bc8790fbdbd
Parent:     272023df26da2668ecc3937f8eeb48c8683b64fa
Author:     Christian Engelmayer <christian.engelmayer at frequentis.com>
AuthorDate: Sat Jun 13 23:06:29 2009 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jun 15 11:17:46 2009 +0100

    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: Christian Engelmayer <christian.engelmayer at frequentis.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 fs/jffs2/scan.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 1d437de..7515e73 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -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;
 



More information about the linux-mtd-cvs mailing list