From ec8676c84f665257f4bf9349d4c12c05e09e31b3 Mon Sep 17 00:00:00 2001 From: Ethan Tidmore Date: Wed, 25 Feb 2026 22:03:54 -0600 Subject: [PATCH] ntfs: Replace ERR_PTR(0) with NULL 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 Reviewed-by: Hyunchul Lee Signed-off-by: Namjae Jeon --- 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)