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

commit de59fae0043f07de5d25e02ca360f7d57bfa5866 upstream.

Fixes: dc6982ff4d ("ext4: refactor code to read directory blocks ...")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org # 3.9
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Vasily Averin 2018-11-07 22:36:23 -05:00 committed by syphyr
parent 11abaf27fb
commit bed3c1f32d
1 changed files with 1 additions and 0 deletions

View File

@ -121,6 +121,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
if (!is_dx_block && type == INDEX) {
ext4_error_inode(inode, __func__, line, block,
"directory leaf block found instead of index block");
brelse(bh);
return ERR_PTR(-EIO);
}
if (!EXT4_HAS_RO_COMPAT_FEATURE(inode->i_sb,