summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2018-11-07 11:01:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-21 09:22:08 +0100
commitef3af4ee5b8150f84ddf7037253510b295f57109 (patch)
tree21ed24844c26c2b9c76293f06a65fa2632ea77e7 /fs
parent2efa77a4df208ac375d2a438852035240a570973 (diff)
ext4: fix buffer leak in ext4_xattr_get_block() on error path
commit ecaaf408478b6fb4d9986f9b6652f3824e374f4c upstream. Fixes: dec214d00e0d ("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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/xattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 302725176571..e66100848bb7 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -2282,8 +2282,10 @@ static struct buffer_head *ext4_xattr_get_block(struct inode *inode)
if (!bh)
return ERR_PTR(-EIO);
error = ext4_xattr_check_block(inode, bh);
- if (error)
+ if (error) {
+ brelse(bh);
return ERR_PTR(error);
+ }
return bh;
}