Commit 349d3bb8 authored by Eric Van Hensbergen's avatar Eric Van Hensbergen

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: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 562ada61
...@@ -108,6 +108,13 @@ static int parse_opts(char *opts, struct p9_client *clnt) ...@@ -108,6 +108,13 @@ static int parse_opts(char *opts, struct p9_client *clnt)
break; break;
case Opt_trans: case Opt_trans:
clnt->trans_mod = v9fs_get_trans_by_name(&args[0]); clnt->trans_mod = v9fs_get_trans_by_name(&args[0]);
if(clnt->trans_mod == NULL) {
P9_DPRINTK(P9_DEBUG_ERROR,
"Could not find request transport: %s\n",
(char *) &args[0]);
ret = -EINVAL;
goto free_and_return;
}
break; break;
case Opt_legacy: case Opt_legacy:
clnt->dotu = 0; clnt->dotu = 0;
...@@ -117,6 +124,7 @@ static int parse_opts(char *opts, struct p9_client *clnt) ...@@ -117,6 +124,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
} }
} }
free_and_return:
kfree(options); kfree(options);
return ret; return ret;
} }
......
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