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'.
Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
---
fs/ntfs/ea.c | 5 ++++-
fs/ntfs/iomap.c | 2 +-
fs/ntfs/namei.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/ntfs/ea.c b/fs/ntfs/ea.c
index ee99baf9c7d2..c4a4a3e3e599 100644
--- a/fs/ntfs/ea.c
+++ b/fs/ntfs/ea.c
@@ -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 */
diff --git a/fs/ntfs/iomap.c b/fs/ntfs/iomap.c
index 621645fbbf2e..3d1458dea90f 100644
--- a/fs/ntfs/iomap.c
+++ b/fs/ntfs/iomap.c
@@ -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));
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 10894de519c3..d5cd2a790678 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -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)
--
2.43.0