[PATCH] ext4: Fix memory leak in ext4_fill_super()

Previous thread: [PATCH 2/2] patch use-separate-ext4_get_blocks_update_reserve_space_flag by Theodore Ts'o on Thursday, May 14, 2009 - 10:59 am. (2 messages)

Next thread: [PATCH] ext3: Fix memory leak in ext3_fill_super() by Manish Katiyar on Thursday, May 14, 2009 - 11:40 am. (1 message)
From: Manish Katiyar
Date: Thursday, May 14, 2009 - 11:37 am

We forget to free up the space allocated for s_blockgroup_lock in case
of failed mounts.
Below patch fixes up the memory leak.

Signed-off-by: Manish Katiyar <mkatiyar@gmail.com>
---
 fs/ext4/super.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2958f4e..fdc1e12 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2862,6 +2862,7 @@ failed_mount:
 	brelse(bh);
 out_fail:
 	sb->s_fs_info = NULL;
+	kfree(sbi->s_blockgroup_lock);
 	kfree(sbi);
 	lock_kernel();
 	return ret;
-- 
1.5.4.3


-- 
Thanks -
Manish
--

From: Theodore Tso
Date: Sunday, May 17, 2009 - 9:09 pm

Thanks, I've applied the ext2, ext3, and ext4 patches into the patch
queue for submission to Linus at the next merge window.

      	  	     	      	 - Ted
--

Previous thread: [PATCH 2/2] patch use-separate-ext4_get_blocks_update_reserve_space_flag by Theodore Ts'o on Thursday, May 14, 2009 - 10:59 am. (2 messages)

Next thread: [PATCH] ext3: Fix memory leak in ext3_fill_super() by Manish Katiyar on Thursday, May 14, 2009 - 11:40 am. (1 message)