aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Marlin <dmarlin@redhat.com>2004-12-21 11:28:46 +0000
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2004-12-21 11:28:46 +0000
commite98d4e529b4fc25dcd519ceee2915aae7f52d79c (patch)
treef2cc17b072f89d7f49d797d9904598390c5c16dd /fs
parent272c050f3a5ecbe5777a48194017c3dfa5908e7b (diff)
downloadhistory-e98d4e529b4fc25dcd519ceee2915aae7f52d79c.tar.gz
JFFS2: Fix freeing of block table on mount failure.
We weren't correctly using vfree() where appropriate in the error case. Signed-off-by: David Marlin <dmarlin@redhat.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/jffs2/build.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c
index 1718bce8daeb1b..a01dd5fdbb95f4 100644
--- a/fs/jffs2/build.c
+++ b/fs/jffs2/build.c
@@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
- * $Id: build.c,v 1.68 2004/11/27 13:38:10 gleixner Exp $
+ * $Id: build.c,v 1.69 2004/12/16 20:22:18 dmarlin Exp $
*
*/
@@ -357,7 +357,11 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
D1(printk(KERN_DEBUG "build_fs failed\n"));
jffs2_free_ino_caches(c);
jffs2_free_raw_node_refs(c);
- kfree(c->blocks);
+ if (c->mtd->flags & MTD_NO_VIRTBLOCKS) {
+ vfree(c->blocks);
+ } else {
+ kfree(c->blocks);
+ }
return -EIO;
}