Skip to content

Commit de59fae

Browse files
vaverintytso
authored andcommitted
ext4: fix buffer leak in __ext4_read_dirblock() on error path
Fixes: dc6982f ("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
1 parent 53692ec commit de59fae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/ext4/namei.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ static struct buffer_head *__ext4_read_dirblock(struct inode *inode,
126126
if (!is_dx_block && type == INDEX) {
127127
ext4_error_inode(inode, func, line, block,
128128
"directory leaf block found instead of index block");
129+
brelse(bh);
129130
return ERR_PTR(-EFSCORRUPTED);
130131
}
131132
if (!ext4_has_metadata_csum(inode->i_sb) ||

0 commit comments

Comments
 (0)