]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
9pnet_rdma: check token type before int conversion
authorSimon Derr <simon.derr@bull.net>
Tue, 11 Mar 2014 09:14:15 +0000 (10:14 +0100)
committerEric Van Hensbergen <ericvh@gmail.com>
Tue, 25 Mar 2014 21:38:19 +0000 (16:38 -0500)
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>
net/9p/trans_rdma.c

index 8f5e4f769d137462f78ccd54cc87790ad0785248..14ad43b5cf89a323f3de9d2ca03879f4b4c9bf35 100644 (file)
@@ -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,