Skip to contentSkip to conversation

ntfs: fix uninitialized symbol warnings

PATCH New Hyunchul Lee 1 participant 1 message Apr 11

Subsystems (2)
lore
Share & tools
lore

Hyunchul Lee

author maintainer
#0 lore raw

PATCH 1/1 ntfs: fix uninitialized symbol warnings

Detected by Smatch:

fs/ntfs/ea.c:444
ntfs_ea_set_wsl_inode() error: uninitialized symbol 'err'.
fs/ntfs/namei.c:651
__ntfs_create() error: uninitialized symbol 'ea_size.
fs/ntfs/iomap.c:517
ntfs_write_simple_iomap_begin_non_resident()
error: uninitialized symbol 'err'.

---
 fs/ntfs/ea.c    | 5 ++++-
 fs/ntfs/iomap.c | 2 +-
 fs/ntfs/namei.c | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)
fs/ntfs/ea.c +4 -1
index ee99baf9c7d2..c4a4a3e3e599 100644
@@ -406,7 +406,10 @@ int ntfs_ea_set_wsl_inode(struct inode *inode, dev_t rdev, __le16 *ea_size,
 		unsigned int flags)
 {
 	__le32 v;
-	int err;
+	int err = 0;
+
+	if (ea_size)
+		*ea_size = 0;
 
 	if (flags & NTFS_EA_UID) {
 		/* Store uid to lxuid EA */
fs/ntfs/iomap.c +1 -1
index 621645fbbf2e..3d1458dea90f 100644
@@ -384,7 +384,7 @@ static int ntfs_write_simple_iomap_begin_non_resident(struct inode *inode, loff_
 	loff_t vcn_ofs, rl_length;
 	struct runlist_element *rl, *rlc;
 	bool is_retry = false;
-	int err;
+	int err = 0;
 	s64 vcn, lcn;
 	s64 max_clu_count =
 		ntfs_bytes_to_cluster(vol, round_up(length, vol->cluster_size));
fs/ntfs/namei.c +1 -1
index 10894de519c3..d5cd2a790678 100644
@@ -408,7 +408,7 @@ static struct ntfs_inode *__ntfs_create(struct mnt_idmap *idmap, struct inode *d
 	struct super_block *sb = dir_ni->vol->sb;
 	__le64 parent_mft_ref;
 	u64 child_mft_ref;
-	__le16 ea_size;
+	__le16 ea_size = 0;
 
 	vi = new_inode(vol->sb);
 	if (!vi)
Signature · 1 line
2.43.0