From: Ethan Tidmore Date: Thu, 26 Feb 2026 04:03:54 +0000 (-0600) Subject: ntfs: Replace ERR_PTR(0) with NULL X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec8676c84f665257f4bf9349d4c12c05e09e31b3;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index a21eeaec57b4e..cecfaabfbfe7f 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)