summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2026-01-05 12:17:10 -0700
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2026-01-16 14:18:06 +0100
commitca1ceddfaa99e91da8b7ac24785b27d400b88309 (patch)
tree758f67e60ea40c6ac2a4786d270f24b1f1dfad53 /fs
parent6b3c83df9a0a61eb7a11beb1cef7ae5c2eb3efb6 (diff)
ntfs3: Restore NULL folio initialization in ntfs_writepages()
Clang warns (or errors with CONFIG_WERROR=y): fs/ntfs3/inode.c:1021:6: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 1021 | if (is_resident(ni)) { | ^~~~~~~~~~~~~~~ fs/ntfs3/inode.c:1024:48: note: uninitialized use occurs here 1024 | while ((folio = writeback_iter(mapping, wbc, folio, &err))) | ^~~~~ folio should be initialized to NULL for the first iteration of writeback_iter() to start the loop properly. Restore the NULL initialization of folio that was lost in the recent iomap conversion to clear up the warning. Fixes: 099ef9a ("fs/ntfs3: implement iomap-based file operations") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/oe-kbuild-all/202601010644.FIhOXy6Y-lkp@intel.com/ Closes: https://lore.kernel.org/r/202601010513.axd56bks-lkp@intel.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> [almaz.alexandrovich@paragon-software.com: added a few more tags] Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs3/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 636aa77e20e4..2147fce8e0b2 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -1019,7 +1019,7 @@ static int ntfs_writepages(struct address_space *mapping,
return -EIO;
if (is_resident(ni)) {
- struct folio *folio;
+ struct folio *folio = NULL;
while ((folio = writeback_iter(mapping, wbc, folio, &err)))
err = ntfs_resident_writepage(folio, wbc);