diff options
author | Abhishek Kulkarni <adkulkar@umail.iu.edu> | 2009-07-01 04:50:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-02 16:17:01 -0400 |
commit | 15da4b1612d608a47e095439b3dd1d77ffe20e0c (patch) | |
tree | bc698a7851c73e86e2ac8ef8bfe32c14aff6c71c /net/9p/trans_fd.c | |
parent | 887b5ea3683ce04966e35fa2e5fe215bedcde73c (diff) |
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>
Diffstat (limited to 'net/9p/trans_fd.c')
-rw-r--r-- | net/9p/trans_fd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index a2a1814c7a8d..8c2588e4edc0 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c | |||
@@ -735,12 +735,14 @@ static int parse_opts(char *params, struct p9_fd_opts *opts) | |||
735 | if (!*p) | 735 | if (!*p) |
736 | continue; | 736 | continue; |
737 | token = match_token(p, tokens, args); | 737 | token = match_token(p, tokens, args); |
738 | r = match_int(&args[0], &option); | 738 | if (token != Opt_err) { |
739 | if (r < 0) { | 739 | r = match_int(&args[0], &option); |
740 | P9_DPRINTK(P9_DEBUG_ERROR, | 740 | if (r < 0) { |
741 | "integer field, but no integer?\n"); | 741 | P9_DPRINTK(P9_DEBUG_ERROR, |
742 | ret = r; | 742 | "integer field, but no integer?\n"); |
743 | continue; | 743 | ret = r; |
744 | continue; | ||
745 | } | ||
744 | } | 746 | } |
745 | switch (token) { | 747 | switch (token) { |
746 | case Opt_port: | 748 | case Opt_port: |