From: Ethan Tidmore <ethantidmore06@gmail.com>
To: linkinjeon@kernel.org, hyc.lee@gmail.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Ethan Tidmore <ethantidmore06@gmail.com>
Subject: [PATCH 1/2] ntfs: Replace ERR_PTR(0) with NULL
Date: Wed, 25 Feb 2026 22:03:54 -0600 [thread overview]
Message-ID: <20260226040355.1974628-2-ethantidmore06@gmail.com> (raw)
In-Reply-To: <20260226040355.1974628-1-ethantidmore06@gmail.com>
The variable err is confirmed to be 0 and then never reassigned in the
success path. The function then returns with ERR_PTR(err) which just
equals NULL and can be misleading.
Detected by Smatch:
fs/ntfs/namei.c:1091 ntfs_mkdir() warn:
passing zero to 'ERR_PTR'
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
fs/ntfs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index a21eeaec57b4..cecfaabfbfe7 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -1088,7 +1088,7 @@ static struct dentry *ntfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
}
d_instantiate_new(dentry, VFS_I(ni));
- return ERR_PTR(err);
+ return NULL;
}
static int ntfs_rmdir(struct inode *dir, struct dentry *dentry)
--
2.53.0
next prev parent reply other threads:[~2026-02-26 4:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 4:03 [PATCH 0/2] ntfs: Fix two minor issues in namei.c Ethan Tidmore
2026-02-26 4:03 ` Ethan Tidmore [this message]
2026-02-26 5:39 ` [PATCH 1/2] ntfs: Replace ERR_PTR(0) with NULL Hyunchul Lee
2026-02-26 4:03 ` [PATCH 2/2] ntfs: Remove impossible condition Ethan Tidmore
2026-02-26 5:40 ` Hyunchul Lee
2026-02-26 9:29 ` [PATCH 0/2] ntfs: Fix two minor issues in namei.c Namjae Jeon
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=20260226040355.1974628-2-ethantidmore06@gmail.com \
--to=ethantidmore06@gmail.com \
--cc=hyc.lee@gmail.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
all inboxes | Powered by JetHome®