fs/ntfs3: Fix error code in indx_add_allocate()

Return -EINVAL if ni_find_attr() fails.  Don't return success.

Fixes: 82cae269cf ("fs/ntfs3: Add initialization of super block")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Dan Carpenter 2021-08-24 10:49:32 +03:00 committed by Konstantin Komarov
parent 2926e42970
commit 04810f000a
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -1500,6 +1500,7 @@ static int indx_add_allocate(struct ntfs_index *indx, struct ntfs_inode *ni,
alloc = ni_find_attr(ni, NULL, NULL, ATTR_ALLOC, in->name, in->name_len,
NULL, &mi);
if (!alloc) {
err = -EINVAL;
if (bmp)
goto out2;
goto out1;