diff options
author | Eric Biggers <ebiggers@google.com> | 2017-03-15 15:08:48 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-03-15 15:08:48 -0400 |
commit | cd9cb405e0b948363811dc74dbb2890f56f2cb87 (patch) | |
tree | 6390b945bfba94fc1f7cbc37a0151755ab94214e /fs/jbd2/revoke.c | |
parent | b9cf625d6ecde0d372e23ae022feead72b4228a6 (diff) |
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: f0c9fd5458bacf7b12a9a579a727dc740cbe047e
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jbd2/revoke.c')
-rw-r--r-- | fs/jbd2/revoke.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index cfc38b552118..f9aefcda5854 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -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; } |