]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nilfs2: Fix return in nilfs_mkdir
authorHongling Zeng <zenghongling@kylinos.cn>
Wed, 20 May 2026 10:15:47 +0000 (19:15 +0900)
committerViacheslav Dubeyko <slava@dubeyko.com>
Wed, 20 May 2026 18:20:56 +0000 (11:20 -0700)
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 <zenghongling@kylinos.cn>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
fs/nilfs2/namei.c

index 40ac679ec56e400b1df98e9be6fe9ca338a9ba51..e2fe95de3d71caef6746573ee7981c09d6a5b43c 100644 (file)
@@ -258,7 +258,7 @@ out:
        else
                nilfs_transaction_abort(dir->i_sb);
 
-       return ERR_PTR(err);
+       return err ? ERR_PTR(err) : NULL;
 
 out_fail:
        drop_nlink(inode);