From: Vasily Averin Date: Thu, 8 Nov 2018 03:36:23 +0000 (-0500) Subject: ext4: fix buffer leak in __ext4_read_dirblock() on error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d450fcdb42e72939f42d8bb696546b31d6b89204;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ext4: fix buffer leak in __ext4_read_dirblock() on error path commit de59fae0043f07de5d25e02ca360f7d57bfa5866 upstream. Fixes: dc6982ff4db1 ("ext4: refactor code to read directory blocks ...") Signed-off-by: Vasily Averin Signed-off-by: Theodore Ts'o Cc: stable@kernel.org # 3.9 Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 7a1070913e44..3c3757ee11f0 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -124,6 +124,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(-EFSCORRUPTED); } if (!ext4_has_metadata_csum(inode->i_sb) ||