summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHongling Zeng <zenghongling@kylinos.cn>2026-05-20 05:26:50 +0300
committerDominique Martinet <asmadeus@codewreck.org>2026-06-21 08:22:56 +0300
commit314b58c01a9047567fd19446ca5fd46c473b89ff (patch)
tree52df2bea6db8f174e5348122c452b718915cebb9 /scripts
parent1a3860d46e3eb47dbd60339783cdad7904486b9f (diff)
downloadlinux-314b58c01a9047567fd19446ca5fd46c473b89ff.tar.xz
9p: avoid returning ERR_PTR(0) from mkdir operations
When mkdir succeeds, v9fs_vfs_mkdir_dotl() and v9fs_vfs_mkdir() return ERR_PTR(0) which is incorrect. They should return NULL instead for success and ERR_PTR() only with negative error codes for failure. Return NULL instead of passing to ERR_PTR while err is zero Fixes smatch warnings: fs/9p/vfs_inode_dotl.c:420 v9fs_vfs_mkdir_dotl() warn: passing zero to 'ERR_PTR' fs/9p/vfs_inode.c:695 v9fs_vfs_mkdir() warn: passing zero to 'ERR_PTR' The v9fs_vfs_mkdir() code was further simplified because v9fs_create() can never return NULL, so we do not need to check for fid being set separately, and the error path can be a simple return immediately after v9fs_create() failure. There is no intended functional change. Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *") Suggested-by: David Laight <david.laight.linux@gmail.com> Acked-by: Christian Schoenebeck <linux_oss@crudebyte.com> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn> Message-ID: <20260520022650.14217-1-zenghongling@kylinos.cn> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions