Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <error27@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

+1 -1
+1 -1
fs/ntfs/attrib.c
··· 92 92 struct runlist_element *rl; 93 93 struct folio *put_this_folio = NULL; 94 94 int err = 0; 95 - bool ctx_is_temporary = false, ctx_needs_reset; 95 + bool ctx_is_temporary = false, ctx_needs_reset = false; 96 96 struct ntfs_attr_search_ctx old_ctx = { NULL, }; 97 97 size_t new_rl_count; 98 98