jbd2: don't leak memory if setting up journal fails
In journal_init_common(), if we failed to allocate the j_wbuf array, or
if we failed to create the buffer_head for the journal superblock, we
leaked the memory allocated for the revocation tables. Fix this.
Cc: stable@vger.kernel.org # 4.9
Fixes: f0c9fd5458
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
このコミットが含まれているのは:
@@ -280,6 +280,7 @@ int jbd2_journal_init_revoke(journal_t *journal, int hash_size)
|
||||
|
||||
fail1:
|
||||
jbd2_journal_destroy_revoke_table(journal->j_revoke_table[0]);
|
||||
journal->j_revoke_table[0] = NULL;
|
||||
fail0:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
新しいイシューから参照
ユーザーをブロックする