Re: [PATCH v1] 9p: Fix mkdir to return NULL on success

Dominique Martinet <[email protected]> Tue, 19 May 2026 21:21:18 +0900
Newsgroups dev.linux.lists.v9fs,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hongling Zeng wrote on Mon, May 11, 2026 at 02:18:30PM +0800:
> 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'
> 
> This change does not alter the runtime behavior since ERR_PTR(0) and NULL
> are equivalent. However, it improves code readability and silences static
> analyzer warnings.
> 
> Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *")
> Acked-by: Christian Schoenebeck <[email protected]>
> Signed-off-by: Hongling Zeng <[email protected]>

Thanks, I've picked this up with s/Fix/make/ in the commit subject, as I
(subjectively) don't consider this a fix given it's only a style change

-- 
Dominique