]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
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)
committerTim Gardner <tim.gardner@canonical.com>
Thu, 30 Mar 2017 12:35:45 +0000 (06:35 -0600)
commitdc2f32eb2b7bf4c4332e4df19402dc6e4256a136
treeb63451b0d2bb59b3e67a3c7d3dec8764986c1836
parent4d649c9406089f730cf4a76ddb20076e33725012
jbd2: don't leak memory if setting up journal fails

BugLink: http://bugs.launchpad.net/bugs/1677589
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>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/jbd2/journal.c
fs/jbd2/revoke.c