Skip to content

Commit dacc180

Browse files
committed
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 parent 32ba475 commit dacc180

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ntfs/attrib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int ntfs_map_runlist_nolock(struct ntfs_inode *ni, s64 vcn, struct ntfs_attr_sea
9292
struct runlist_element *rl;
9393
struct folio *put_this_folio = NULL;
9494
int err = 0;
95-
bool ctx_is_temporary = false, ctx_needs_reset;
95+
bool ctx_is_temporary = false, ctx_needs_reset = false;
9696
struct ntfs_attr_search_ctx old_ctx = { NULL, };
9797
size_t new_rl_count;
9898

0 commit comments

Comments
 (0)