summaryrefslogtreecommitdiff
path: root/fs/fat
diff options
context:
space:
mode:
authorPekka J Enberg <penberg@cs.Helsinki.FI>2005-06-30 02:59:01 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-30 08:45:11 -0700
commit532a39a3754a3b8ce507414863023f8db21f9a7c (patch)
tree0bd0bed6f235feaabcc7fa77346d82f7fac671c4 /fs/fat
parent9ec55a9bd365dfc78945bb8e6bf5d0fdf1d75ad0 (diff)
[PATCH] fat: fix slab cache leak
This patch plugs a slab cache leak in fat module initialization. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/inode.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8ccee841548..3e31c4a736f 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1331,12 +1331,21 @@ void __exit fat_cache_destroy(void);
static int __init init_fat_fs(void)
{
- int ret;
+ int err;
- ret = fat_cache_init();
- if (ret < 0)
- return ret;
- return fat_init_inodecache();
+ err = fat_cache_init();
+ if (err)
+ return err;
+
+ err = fat_init_inodecache();
+ if (err)
+ goto failed;
+
+ return 0;
+
+failed:
+ fat_cache_destroy();
+ return err;
}
static void __exit exit_fat_fs(void)