2009-05-14 18:41:02

by Manish Katiyar

[permalink] [raw]
Subject: [PATCH] ext3: Fix memory leak in ext3_fill_super()

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 <[email protected]>
---
fs/ext3/super.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 599dbfe..d8b73d4 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2021,6 +2021,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