From: Pekka J Enberg Date: Thu, 30 Jun 2005 09:59:01 +0000 (-0700) Subject: [PATCH] fat: fix slab cache leak X-Git-Tag: MMI-PSA29.97-13-9~57130 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=532a39a3754a3b8ce507414863023f8db21f9a7c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] fat: fix slab cache leak This patch plugs a slab cache leak in fat module initialization. Signed-off-by: Pekka Enberg Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 8ccee8415488..3e31c4a736f1 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)