diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-11-10 04:13:22 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2009-11-11 09:24:14 -0500 |
commit | 7b02bec07efe1d6c7d48c786e0c1a38d28fe7245 (patch) | |
tree | cb93e26c107052be83ba52a74652c44c3ba199da /fs | |
parent | fe8bc91c4c30122b357d197117705cfd4fabaf28 (diff) |
JBD/JBD2: free j_wbuf if journal init fails.
If journal init fails, we need to free j_wbuf.
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jbd/journal.c | 2 | ||||
-rw-r--r-- | fs/jbd2/journal.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index bd3c073b485d..49d5cd6053c8 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -756,6 +756,7 @@ journal_t * journal_init_dev(struct block_device *bdev, | |||
756 | 756 | ||
757 | return journal; | 757 | return journal; |
758 | out_err: | 758 | out_err: |
759 | kfree(journal->j_wbuf); | ||
759 | kfree(journal); | 760 | kfree(journal); |
760 | return NULL; | 761 | return NULL; |
761 | } | 762 | } |
@@ -820,6 +821,7 @@ journal_t * journal_init_inode (struct inode *inode) | |||
820 | 821 | ||
821 | return journal; | 822 | return journal; |
822 | out_err: | 823 | out_err: |
824 | kfree(journal->j_wbuf); | ||
823 | kfree(journal); | 825 | kfree(journal); |
824 | return NULL; | 826 | return NULL; |
825 | } | 827 | } |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index b0ab5219becb..fed85388ee86 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -913,6 +913,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, | |||
913 | 913 | ||
914 | return journal; | 914 | return journal; |
915 | out_err: | 915 | out_err: |
916 | kfree(journal->j_wbuf); | ||
916 | jbd2_stats_proc_exit(journal); | 917 | jbd2_stats_proc_exit(journal); |
917 | kfree(journal); | 918 | kfree(journal); |
918 | return NULL; | 919 | return NULL; |
@@ -986,6 +987,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode) | |||
986 | 987 | ||
987 | return journal; | 988 | return journal; |
988 | out_err: | 989 | out_err: |
990 | kfree(journal->j_wbuf); | ||
989 | jbd2_stats_proc_exit(journal); | 991 | jbd2_stats_proc_exit(journal); |
990 | kfree(journal); | 992 | kfree(journal); |
991 | return NULL; | 993 | return NULL; |