From: Konstantin Komarov Date: Wed, 15 Apr 2026 15:43:47 +0000 (+0200) Subject: fs/ntfs3: fix Smatch warnings X-Git-Tag: v7.1-rc1~76^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=819bd270abf9de3b7f306e233054b85a07c47820;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Konstantin Komarov --- diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index 6b5b58ebbf85..e61c5bf7e27e 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -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; } diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index c0b9ca2426ab..7b035da63c12 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -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;