Skip to content

Commit a8e633c

Browse files
FloridSleevesmartinetd
authored andcommitted
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>
1 parent 0664c63 commit a8e633c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/9p/trans_fd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,9 @@ p9_fd_create(struct p9_client *client, const char *addr, char *args)
10741074
int err;
10751075
struct p9_fd_opts opts;
10761076

1077-
parse_opts(args, &opts);
1077+
err = parse_opts(args, &opts);
1078+
if (err < 0)
1079+
return err;
10781080
client->trans_opts.fd.rfd = opts.rfd;
10791081
client->trans_opts.fd.wfd = opts.wfd;
10801082

0 commit comments

Comments
 (0)