Skip to content

Commit ecaaf40

Browse files
vaverintytso
authored andcommitted
ext4: fix buffer leak in ext4_xattr_get_block() on error path
Fixes: dec214d ("ext4: xattr inode deduplication") Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.13
1 parent af18e35 commit ecaaf40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ext4/xattr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,8 +2272,10 @@ static struct buffer_head *ext4_xattr_get_block(struct inode *inode)
22722272
if (!bh)
22732273
return ERR_PTR(-EIO);
22742274
error = ext4_xattr_check_block(inode, bh);
2275-
if (error)
2275+
if (error) {
2276+
brelse(bh);
22762277
return ERR_PTR(error);
2278+
}
22772279
return bh;
22782280
}
22792281

0 commit comments

Comments
 (0)