[PATCH] fat: fix slab cache leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch plugs a slab cache leak in fat module initialization.

Signed-off-by: Pekka Enberg <[email protected]>
---

 inode.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

Index: 2.6/fs/fat/inode.c
===================================================================
--- 2.6.orig/fs/fat/inode.c	2005-06-17 22:48:29.000000000 +0300
+++ 2.6/fs/fat/inode.c	2005-06-29 08:16:12.000000000 +0300
@@ -1331,12 +1331,21 @@
 
 static int __init init_fat_fs(void)
 {
-	int ret;
+	int err;
+	
+	err = fat_cache_init();
+	if (err)
+		return err;
 
-	ret = fat_cache_init();
-	if (ret < 0)
-		return ret;
-	return fat_init_inodecache();
+	err = fat_init_inodecache();
+	if (err)
+		goto failed;
+
+	return 0;
+
+failed:
+	fat_cache_destroy();
+	return err;
 }
 
 static void __exit exit_fat_fs(void)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux