mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
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: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
887b5ea368
commit
15da4b1612
@ -735,12 +735,14 @@ static int parse_opts(char *params, struct p9_fd_opts *opts)
|
||||
if (!*p)
|
||||
continue;
|
||||
token = match_token(p, tokens, args);
|
||||
r = match_int(&args[0], &option);
|
||||
if (r < 0) {
|
||||
P9_DPRINTK(P9_DEBUG_ERROR,
|
||||
"integer field, but no integer?\n");
|
||||
ret = r;
|
||||
continue;
|
||||
if (token != Opt_err) {
|
||||
r = match_int(&args[0], &option);
|
||||
if (r < 0) {
|
||||
P9_DPRINTK(P9_DEBUG_ERROR,
|
||||
"integer field, but no integer?\n");
|
||||
ret = r;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
switch (token) {
|
||||
case Opt_port:
|
||||
|
Loading…
Reference in New Issue
Block a user