mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
fs: Fix return in jfs_mkdir and orangefs_mkdir
[ Upstream commita7cf1da7ac] Return NULL instead of passing to ERR_PTR while err is zero Fixes these smatch warnings: - fs/jfs/namei.c:311 jfs_mkdir() warn: passing zero to 'ERR_PTR' - fs/orangefs/namei.c:369 orangefs_mkdir() warn: passing zero to 'ERR_PTR' Fixes:88d5baf690("Change inode_operations.mkdir to return struct dentry *") Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn> Link: https://patch.msgid.link/20260501071058.1243245-1-zenghongling@kylinos.cn Reviewed-by: Jori Koolstra <jkoolstra@xs4all.nl> Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e37ea2c6f1
commit
ace6b3e033
+1
-1
@@ -308,7 +308,7 @@ static struct dentry *jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip,
|
||||
out1:
|
||||
|
||||
jfs_info("jfs_mkdir: rc:%d", rc);
|
||||
return ERR_PTR(rc);
|
||||
return rc ? ERR_PTR(rc) : NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -362,7 +362,7 @@ static struct dentry *orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
|
||||
__orangefs_setattr(dir, &iattr);
|
||||
out:
|
||||
op_release(new_op);
|
||||
return ERR_PTR(ret);
|
||||
return ret ? ERR_PTR(ret) : NULL;
|
||||
}
|
||||
|
||||
static int orangefs_rename(struct mnt_idmap *idmap,
|
||||
|
||||
Reference in New Issue
Block a user