Skip to content

Commit e5925f3

Browse files
zenghongling0719dubeyko
authored andcommitted
nilfs2: Fix return in nilfs_mkdir
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: 88d5baf ("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>
1 parent 665f192 commit e5925f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nilfs2/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static struct dentry *nilfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
258258
else
259259
nilfs_transaction_abort(dir->i_sb);
260260

261-
return ERR_PTR(err);
261+
return err ? ERR_PTR(err) : NULL;
262262

263263
out_fail:
264264
drop_nlink(inode);

0 commit comments

Comments
 (0)