JBD/JBD2: free j_wbuf if journal init fails.

If journal init fails, we need to free j_wbuf.

Cc: Andrew Morton <[email protected]>
Cc: Jan Kara <[email protected]>
Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
This commit is contained in:
Tao Ma 2009-11-10 17:13:22 +08:00 • committed by Jan Kara
commit 7b02bec07e
2 changed files with 4 additions and 0 deletions

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;