Commit 4d01f031 authored by Vasily Averin's avatar Vasily Averin Committed by Greg Kroah-Hartman

ext4: fix buffer leak in __ext4_read_dirblock() on error path

commit de59fae0 upstream.

Fixes: dc6982ff ("ext4: refactor code to read directory blocks ...")
Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 3.9
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b0f2b1fe
...@@ -126,6 +126,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode, ...@@ -126,6 +126,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
if (!is_dx_block && type == INDEX) { if (!is_dx_block && type == INDEX) {
ext4_error_inode(inode, func, line, block, ext4_error_inode(inode, func, line, block,
"directory leaf block found instead of index block"); "directory leaf block found instead of index block");
brelse(bh);
return ERR_PTR(-EFSCORRUPTED); return ERR_PTR(-EFSCORRUPTED);
} }
if (!ext4_has_metadata_csum(inode->i_sb) || if (!ext4_has_metadata_csum(inode->i_sb) ||
......
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