diff options
author | Simon Derr <simon.derr@bull.net> | 2014-03-11 10:14:15 +0100 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2014-03-25 22:38:19 +0100 |
commit | 8a5daf1e2c199746767d94b4036638ba11d528b3 (patch) | |
tree | b83a433f7d4662f807dc74677e68a70186542b38 /net/9p/trans_rdma.c | |
parent | 9pnet: trans_fd : allocate struct p9_trans_fd and struct p9_conn together. (diff) | |
download | linux-8a5daf1e2c199746767d94b4036638ba11d528b3.tar.xz linux-8a5daf1e2c199746767d94b4036638ba11d528b3.zip |
9pnet_rdma: check token type before int conversion
When parsing options, make sure we have found a proper token before
doing a numeric conversion.
Without this check, the current code will end up following random
pointers that just happened to be on the stack when this function was
called, because match_token() will not touch the 'args' list unless a
valid token is found.
Signed-off-by: Simon Derr <simon.derr@bull.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/trans_rdma.c')
-rw-r--r-- | net/9p/trans_rdma.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 8f5e4f769d13..14ad43b5cf89 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -193,6 +193,8 @@ static int parse_opts(char *params, struct p9_rdma_opts *opts) if (!*p) continue; token = match_token(p, tokens, args); + if (token == Opt_err) + continue; r = match_int(&args[0], &option); if (r < 0) { p9_debug(P9_DEBUG_ERROR, |