summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-10-01 10:59:03 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-10-01 10:59:03 -0700
commit9230fbc5ec7d33b4071b2f04547bf70ab1712040 (patch)
tree00cf5bdbb44dae870c406a199727bec63cf3c118
parent1f6fcc21f5c0e6a50228b104586b22880c7e1ddb (diff)
[PATCH] befs: fix resource leak on register_filesystem failure
From: Will Dyson <will_dyson@pobox.com> Remember to free the inode cache if register_filesystem() fails.
-rw-r--r--fs/befs/linuxvfs.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 888122632846..c0316c7d9c23 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -947,9 +947,19 @@ init_befs_fs(void)
err = befs_init_inodecache();
if (err)
- return err;
+ goto unaquire_none;
+
+ err = register_filesystem(&befs_fs_type);
+ if (err)
+ goto unaquire_inodecache;
+
+ return 0;
+
+unaquire_inodecache:
+ befs_destroy_inodecache();
- return register_filesystem(&befs_fs_type);
+unaquire_none:
+ return err;
}
static void __exit