diff options
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/build.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c index 02826967ab58..07119c42a861 100644 --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c | |||
@@ -348,23 +348,27 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c) | |||
348 | 348 | ||
349 | ret = jffs2_sum_init(c); | 349 | ret = jffs2_sum_init(c); |
350 | if (ret) | 350 | if (ret) |
351 | return ret; | 351 | goto out_free; |
352 | 352 | ||
353 | if (jffs2_build_filesystem(c)) { | 353 | if (jffs2_build_filesystem(c)) { |
354 | dbg_fsbuild("build_fs failed\n"); | 354 | dbg_fsbuild("build_fs failed\n"); |
355 | jffs2_free_ino_caches(c); | 355 | jffs2_free_ino_caches(c); |
356 | jffs2_free_raw_node_refs(c); | 356 | jffs2_free_raw_node_refs(c); |
357 | #ifndef __ECOS | 357 | ret = -EIO; |
358 | if (jffs2_blocks_use_vmalloc(c)) | 358 | goto out_free; |
359 | vfree(c->blocks); | ||
360 | else | ||
361 | #endif | ||
362 | kfree(c->blocks); | ||
363 | |||
364 | return -EIO; | ||
365 | } | 359 | } |
366 | 360 | ||
367 | jffs2_calc_trigger_levels(c); | 361 | jffs2_calc_trigger_levels(c); |
368 | 362 | ||
369 | return 0; | 363 | return 0; |
364 | |||
365 | out_free: | ||
366 | #ifndef __ECOS | ||
367 | if (jffs2_blocks_use_vmalloc(c)) | ||
368 | vfree(c->blocks); | ||
369 | else | ||
370 | #endif | ||
371 | kfree(c->blocks); | ||
372 | |||
373 | return ret; | ||
370 | } | 374 | } |