summaryrefslogtreecommitdiff
path: root/fs/ntfs3/attrib.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-06-30 16:10:56 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2022-07-05 16:07:53 +0300
commit4838ec0d80b110a5f30c7e3169dc5021efd203d4 (patch)
tree372ec5158e414933accc73204f8337058d3643b7 /fs/ntfs3/attrib.c
parente66af07ca2b57e01dbf6001ae565ab40037b2df3 (diff)
downloadlinux-4838ec0d80b110a5f30c7e3169dc5021efd203d4.tar.xz
fs/ntfs3: Unlock on error in attr_insert_range()
This error path needs to call up_write(&ni->file.run_lock) and do some other clean up before returning. Fixes: aa30eccb24e5 ("fs/ntfs3: Fallocate (FALLOC_FL_INSERT_RANGE) implementation") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3/attrib.c')
-rw-r--r--fs/ntfs3/attrib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c
index 86e688b95ad5..3e9aefcb3e6c 100644
--- a/fs/ntfs3/attrib.c
+++ b/fs/ntfs3/attrib.c
@@ -2153,8 +2153,10 @@ int attr_insert_range(struct ntfs_inode *ni, u64 vbo, u64 bytes)
le_b = NULL;
attr_b = ni_find_attr(ni, NULL, &le_b, ATTR_DATA, NULL, 0, NULL,
&mi_b);
- if (!attr_b)
- return -ENOENT;
+ if (!attr_b) {
+ err = -ENOENT;
+ goto out;
+ }
if (!attr_b->non_res) {
err = -EINVAL;
goto out;