Commit 15da4b16 authored by Abhishek Kulkarni's avatar Abhishek Kulkarni Committed by David S. Miller

net/9p: Fix crash due to bad mount parameters.

It is not safe to use match_int without checking the token type returned
by match_token (especially when the token type returned is Opt_err and
args is empty). Fix it.
Signed-off-by: default avatarAbhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 887b5ea3
...@@ -735,12 +735,14 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) ...@@ -735,12 +735,14 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
if (!*p) if (!*p)
continue; continue;
token = match_token(p, tokens, args); token = match_token(p, tokens, args);
r = match_int(&args[0], &option); if (token != Opt_err) {
if (r < 0) { r = match_int(&args[0], &option);
P9_DPRINTK(P9_DEBUG_ERROR, if (r < 0) {
"integer field, but no integer?\n"); P9_DPRINTK(P9_DEBUG_ERROR,
ret = r; "integer field, but no integer?\n");
continue; ret = r;
continue;
}
} }
switch (token) { switch (token) {
case Opt_port: case Opt_port:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment