[PATCH] ext4: fix ext4_fill_super memory leak

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

 



When ext4_fill_super fails, s_flex_groups is not freed.
Fix it.

Signed-off-by: Shen Feng <shen@xxxxxxxxxxxxxx>
---
 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 b5479b1..6ed0e27 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2487,6 +2487,7 @@ failed_mount4:
 	jbd2_journal_destroy(sbi->s_journal);
 	sbi->s_journal = NULL;
 failed_mount3:
+	kfree(sbi->s_flex_groups);
 	percpu_counter_destroy(&sbi->s_freeblocks_counter);
 	percpu_counter_destroy(&sbi->s_freeinodes_counter);
 	percpu_counter_destroy(&sbi->s_dirs_counter);
-- 
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux