Re: [PATCH 2/3] nilfs2: Fix return in nilfs_mkdir

Ryusuke Konishi <[email protected]> Sun, 3 May 2026 16:42:42 +0900
Newsgroups org.kernel.vger.linux-nilfs,org.kernel.vger.linux-kernel
Message-ID <CAKFNMomo6Np0=83XtJphysi6CbN0i9_r5h6K=j8suR6Q75CRdg@mail.gmail.com>
On Sun, May 3, 2026 at 1:16 PM Hongling Zeng wrote:
>
> Return NULL instead of passing zero to ERR_PTR.
>   Fixes smatch warning:
>      - fs/nilfs2/namei.c:261 nilfs_mkdir() warn: passing zero to 'ERR_PTR'
>
> Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *")
> Signed-off-by: Hongling Zeng <[email protected]>
> ---
>  fs/nilfs2/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
> index 40ac679ec56e..e2fe95de3d71 100644
> --- a/fs/nilfs2/namei.c
> +++ b/fs/nilfs2/namei.c
> @@ -258,7 +258,7 @@ static struct dentry *nilfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
>         else
>                 nilfs_transaction_abort(dir->i_sb);
>
> -       return ERR_PTR(err);
> +       return err ? ERR_PTR(err) : NULL;
>
>  out_fail:
>         drop_nlink(inode);
> --
> 2.25.1
>

Thanks for the patch.
This is part of a series of fixes, but since you intend for it to be
treated as a standalone fix, I will queue it as such.

Thanks,
Ryusuke Konishi