Skip to content

Commit 8a59a2d

Browse files
committed
ntfs: fix uninitialized variable in ntfs_write_simple_iomap_begin_non_resident
Smatch reported that err could be used uninitialized if the code path does not enter the first ntfs_zero_range() block. 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 cf29a21 commit 8a59a2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ntfs/iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ static int ntfs_write_simple_iomap_begin_non_resident(struct inode *inode, loff_
384384
loff_t vcn_ofs, rl_length;
385385
struct runlist_element *rl, *rlc;
386386
bool is_retry = false;
387-
int err;
387+
int err = 0;
388388
s64 vcn, lcn;
389389
s64 max_clu_count =
390390
ntfs_bytes_to_cluster(vol, round_up(length, vol->cluster_size));

0 commit comments

Comments
 (0)