Linux filesystem development
 help / color / mirror / Atom feed
From: Hyunchul Lee <hyc.lee@gmail.com>
To: Ethan Tidmore <ethantidmore06@gmail.com>
Cc: linkinjeon@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ntfs: Replace ERR_PTR(0) with NULL
Date: Thu, 26 Feb 2026 14:39:21 +0900	[thread overview]
Message-ID: <aZ_ciVEhl-0PHfQ5@hyunchul-PC02> (raw)
In-Reply-To: <20260226040355.1974628-2-ethantidmore06@gmail.com>

On Wed, Feb 25, 2026 at 10:03:54PM -0600, Ethan Tidmore wrote:
> 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>

Looks good to me. Thanks for the patch.

Reviewed-by: Hyunchul Lee <hyc.lee@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
> 

-- 
Thanks,
Hyunchul

  reply	other threads:[~2026-02-26  5:39 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 ` [PATCH 1/2] ntfs: Replace ERR_PTR(0) with NULL Ethan Tidmore
2026-02-26  5:39   ` Hyunchul Lee [this message]
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=aZ_ciVEhl-0PHfQ5@hyunchul-PC02 \
    --to=hyc.lee@gmail.com \
    --cc=ethantidmore06@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