fs/ntfs3: fix Smatch warnings

Initialize err in ni_allocate_da_blocks_locked() and correct the
pre_alloc condition in attr_allocate_clusters().

Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Konstantin Komarov 2026-04-15 17:43:47 +02:00
parent 0ca0485e4b
commit 819bd270ab
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6
2 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run,
if (err == -ENOSPC && pre) {
pre = 0;
if (*pre_alloc)
if (pre_alloc)
*pre_alloc = 0;
continue;
}

View File

@ -3267,7 +3267,7 @@ int ni_allocate_da_blocks(struct ntfs_inode *ni)
*/
int ni_allocate_da_blocks_locked(struct ntfs_inode *ni)
{
int err;
int err = 0;
if (!ni->file.run_da.count)
return 0;