public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hyunchul Lee <hyc.lee@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Hyunchul Lee <hyc.lee@gmail.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	cheol.lee@lge.com
Subject: [PATCH] ntfs: fix uninitialized symbol warnings
Date: Sat, 11 Apr 2026 08:35:53 +0900	[thread overview]
Message-ID: <20260410233553.2542229-1-hyc.lee@gmail.com> (raw)

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


                 reply	other threads:[~2026-04-11  0:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260410233553.2542229-1-hyc.lee@gmail.com \
    --to=hyc.lee@gmail.com \
    --cc=cheol.lee@lge.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox