Skip to content

Commit

Permalink
net/9p: clarify trans_fd parse_opt failure handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zhong authored and Dominique Martinet committed Oct 7, 2022
1 parent 0664c63 commit a8e633c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a8e633c

Please sign in to comment.