Commit 7b02bec0 authored by Tao Ma's avatar Tao Ma Committed by Jan Kara

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: default avatarTao Ma <tao.ma@oracle.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent fe8bc91c
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment