public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: [bug report] ntfs: add reparse and ea operations
Date: Fri, 10 Apr 2026 09:47:04 +0300	[thread overview]
Message-ID: <adic6OYLSfoUEcDu@stanley.mountain> (raw)

Hello Namjae Jeon,

Commit fc053f05ca28 ("ntfs: add reparse and ea operations") from Feb
13, 2026 (linux-next), leads to the following Smatch static checker
warning:

    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/ea.c
    405 int ntfs_ea_set_wsl_inode(struct inode *inode, dev_t rdev, __le16 *ea_size,
    406                 unsigned int flags)
    407 {
    408         __le32 v;
    409         int err;
    410 
    411         if (flags & NTFS_EA_UID) {
    412                 /* Store uid to lxuid EA */
    413                 v = cpu_to_le32(i_uid_read(inode));
    414                 err = ntfs_set_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &v,
    415                                 sizeof(v), 0, ea_size);
    416                 if (err)
    417                         return err;
    418         }
    419 
    420         if (flags & NTFS_EA_GID) {
    421                 /* Store gid to lxgid EA */
    422                 v = cpu_to_le32(i_gid_read(inode));
    423                 err = ntfs_set_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &v,
    424                                 sizeof(v), 0, ea_size);
    425                 if (err)
    426                         return err;
    427         }
    428 
    429         if (flags & NTFS_EA_MODE) {
    430                 /* Store mode to lxmod EA */
    431                 v = cpu_to_le32(inode->i_mode);
    432                 err = ntfs_set_ea(inode, "$LXMOD", sizeof("$LXMOD") - 1, &v,
    433                                 sizeof(v), 0, ea_size);
    434                 if (err)
    435                         return err;
    436         }
    437 
    438         if (rdev) {

err needs to be initialized if rdev is false.

    439                 v = cpu_to_le32(rdev);
    440                 err = ntfs_set_ea(inode, "$LXDEV", sizeof("$LXDEV") - 1, &v, sizeof(v),
    441                                 0, ea_size);
    442         }
    443 
--> 444         return err;
                ^^^^^^^^^^^
Also Smatch thinks that this function can return success without setting
ea_size.

    445 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

                 reply	other threads:[~2026-04-10  6:47 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=adic6OYLSfoUEcDu@stanley.mountain \
    --to=error27@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@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