From: Namjae Jeon Date: Fri, 10 Apr 2026 15:18:30 +0000 (+0900) Subject: ntfs: fix uninitialized variable in ntfs_map_runlist_nolock X-Git-Tag: v7.1-rc1~14^2~3 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=dacc18029ef69ed225fdb4d7c3215c285e9e8ef4;p=thirdparty%2Fkernel%2Flinux.git ntfs: fix uninitialized variable in ntfs_map_runlist_nolock Smatch reported that ctx_needs_reset could be used uninitialized if ntfs_map_runlist_nolock() fails early when a search context is provided. Specifically, if the function returns -EIO because the attribute is resident, the code jumps to err_out. This initializes ctx_needs_reset to false to satisfy the static checker. Reported-by: Dan Carpenter Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index e8cc74c9c9a7..97b660eaa00c 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c @@ -92,7 +92,7 @@ int ntfs_map_runlist_nolock(struct ntfs_inode *ni, s64 vcn, struct ntfs_attr_sea struct runlist_element *rl; struct folio *put_this_folio = NULL; int err = 0; - bool ctx_is_temporary = false, ctx_needs_reset; + bool ctx_is_temporary = false, ctx_needs_reset = false; struct ntfs_attr_search_ctx old_ctx = { NULL, }; size_t new_rl_count;