diff mbox

[V9fs-developer] net/9p: fail when user specifies a transport which we can't find

Message ID 1263418793-31582-2-git-send-email-ericvh@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

Eric Van Hensbergen Jan. 13, 2010, 9:39 p.m. UTC
None
diff mbox

Patch

diff --git a/net/9p/client.c b/net/9p/client.c
index 8af95b2..5941ce8 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)
 			break;
 		case Opt_trans:
 			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",
+					&args[0]);
+					ret = -EINVAL;
+					goto free_and_return;
+			}
 			break;
 		case Opt_legacy:
 			clnt->dotu = 0;
@@ -117,6 +124,7 @@  static int parse_opts(char *opts, struct p9_client *clnt)
 		}
 	}
 
+free_and_return;
 	kfree(options);
 	return ret;
 }