jbd2: don't leak memory if setting up journal fails
authorEric Biggers <ebiggers@google.com>
Wed, 15 Mar 2017 19:08:48 +0000 (15:08 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2017 07:41:27 +0000 (09:41 +0200)
commitb176a6eed370dce9f96445d75d3f19c5db3f6bbf
tree0a27f62d1a82e158939d5e1be74d98612c827ec1
parent90f39ad2ce9424048678862d096e07a141480120
jbd2: don't leak memory if setting up journal fails

commit cd9cb405e0b948363811dc74dbb2890f56f2cb87 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jbd2/journal.c
fs/jbd2/revoke.c