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>
This commit is contained in:
Tao Ma 2009-11-10 17:13:22 +08:00 committed by Jan Kara
parent fe8bc91c4c
commit 7b02bec07e
2 changed files with 4 additions and 0 deletions

View file

@ -756,6 +756,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
return journal;
out_err:
kfree(journal->j_wbuf);
kfree(journal);
return NULL;
}
@ -820,6 +821,7 @@ journal_t * journal_init_inode (struct inode *inode)
return journal;
out_err:
kfree(journal->j_wbuf);
kfree(journal);
return NULL;
}

View file

@ -913,6 +913,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
return journal;
out_err:
kfree(journal->j_wbuf);
jbd2_stats_proc_exit(journal);
kfree(journal);
return NULL;
@ -986,6 +987,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
return journal;
out_err:
kfree(journal->j_wbuf);
jbd2_stats_proc_exit(journal);
kfree(journal);
return NULL;