summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAbhishek Kulkarni <adkulkar@umail.iu.edu>2009-07-01 10:50:54 +0200
committerDavid S. Miller <davem@davemloft.net>2009-07-02 22:17:01 +0200
commit15da4b1612d608a47e095439b3dd1d77ffe20e0c (patch)
treebc698a7851c73e86e2ac8ef8bfe32c14aff6c71c /net
parentif_ether: add define for 1588 aka Timesync (diff)
downloadlinux-15da4b1612d608a47e095439b3dd1d77ffe20e0c.tar.xz
linux-15da4b1612d608a47e095439b3dd1d77ffe20e0c.zip
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')
-rw-r--r--net/9p/trans_fd.c14
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)
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: