Skip to content
Snippets Groups Projects
Commit 6068f893 authored by Dominique Martinet's avatar Dominique Martinet Committed by Frieder Schrempf
Browse files

9p: v9fs_listxattr: fix %s null argument warning

[ Upstream commit 9b5c6281 ]

W=1 warns about null argument to kprintf:
In file included from fs/9p/xattr.c:12:
In function ‘v9fs_xattr_get’,
    inlined from ‘v9fs_listxattr’ at fs/9p/xattr.c:142:9:
include/net/9p/9p.h:55:2: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
   55 |  _p9_debug(level, __func__, fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Use an empty string instead of :
 - this is ok 9p-wise because p9pdu_vwritef serializes a null string
and an empty string the same way (one '0' word for length)
 - since this degrades the print statements, add new single quotes for
xattr's name delimter (Old: "file = (null)", new: "file = ''")

Link: https://lore.kernel.org/r/20231008060138.517057-1-suhui@nfschina.com


Suggested-by: default avatarSu Hui <suhui@nfschina.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
Acked-by: default avatarChristian Schoenebeck <linux_oss@crudebyte.com>
Message-ID: <20231025103445.1248103-2-asmadeus@codewreck.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6b1e79fd
No related branches found
No related tags found
1 merge request!119🤖 Sync Bot: Update v6.1-ktn to Latest Stable Kernel (v6.1.66)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment