diff options
author | Eric Van Hensbergen <ericvh@gmail.com> | 2010-01-15 20:01:10 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2010-02-08 15:13:30 -0500 |
commit | 349d3bb878d71978650a0634b5445af3c1cc1cd8 (patch) | |
tree | ec0760ddef95d3afdfb00611cbd64941958e2b00 /net/9p | |
parent | 562ada612058133a5483c68a73605f3c5f42fffe (diff) |
net/9p: fail when user specifies a transport which we can't find
If the user specifies a transport and we can't find it, we failed back
to the default trainsport silently. This patch will make the code
complain more loudly and return an error code.
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 8af95b2dddd6..90a2eb926d19 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -108,6 +108,13 @@ static int parse_opts(char *opts, struct p9_client *clnt) | |||
108 | break; | 108 | break; |
109 | case Opt_trans: | 109 | case Opt_trans: |
110 | clnt->trans_mod = v9fs_get_trans_by_name(&args[0]); | 110 | clnt->trans_mod = v9fs_get_trans_by_name(&args[0]); |
111 | if(clnt->trans_mod == NULL) { | ||
112 | P9_DPRINTK(P9_DEBUG_ERROR, | ||
113 | "Could not find request transport: %s\n", | ||
114 | (char *) &args[0]); | ||
115 | ret = -EINVAL; | ||
116 | goto free_and_return; | ||
117 | } | ||
111 | break; | 118 | break; |
112 | case Opt_legacy: | 119 | case Opt_legacy: |
113 | clnt->dotu = 0; | 120 | clnt->dotu = 0; |
@@ -117,6 +124,7 @@ static int parse_opts(char *opts, struct p9_client *clnt) | |||
117 | } | 124 | } |
118 | } | 125 | } |
119 | 126 | ||
127 | free_and_return: | ||
120 | kfree(options); | 128 | kfree(options); |
121 | return ret; | 129 | return ret; |
122 | } | 130 | } |