summaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorLi Zhong <floridsleeves@gmail.com>2022-09-21 23:09:21 +0200
committerDominique Martinet <asmadeus@codewreck.org>2022-10-07 14:23:09 +0200
commita8e633c604476e24d26a636582c0f5bdb421e70d (patch)
treeaec6157e028408f1b4f0e3a604ec57004868f9e4 /net/9p
parentnet/9p: add __init/__exit annotations to module init/exit funcs (diff)
downloadlinux-a8e633c604476e24d26a636582c0f5bdb421e70d.tar.xz
linux-a8e633c604476e24d26a636582c0f5bdb421e70d.zip
net/9p: clarify trans_fd parse_opt failure handling
This parse_opts will set invalid opts.rfd/wfd in case of failure which we already check, but it is not clear for readers that parse_opts error are handled in p9_fd_create: clarify this by explicitely checking the return value. Link: https://lkml.kernel.org/r/20220921210921.1654735-1-floridsleeves@gmail.com Signed-off-by: Li Zhong <floridsleeves@gmail.com> [Dominique: reworded commit message to clarify this is NOOP] Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/trans_fd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 97db11e4cf58..56a186768750 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -1074,7 +1074,9 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
int err;
struct p9_fd_opts opts;
- parse_opts(args, &opts);
+ err = parse_opts(args, &opts);
+ if (err < 0)
+ return err;
client->trans_opts.fd.rfd = opts.rfd;
client->trans_opts.fd.wfd = opts.wfd;