From patchwork Wed Jan 13 21:39:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 72724 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0DLuN3H011074 for ; Wed, 13 Jan 2010 21:56:23 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NVBCP-0005Rz-7h; Wed, 13 Jan 2010 21:56:21 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NVBCI-0005RE-7L for v9fs-developer@lists.sourceforge.net; Wed, 13 Jan 2010 21:56:16 +0000 Received-SPF: neutral (sfi-mx-2.v28.ch3.sourceforge.com: 32.97.110.159 is neither permitted nor denied by domain of gmail.com) client-ip=32.97.110.159; envelope-from=ericvh@gmail.com; helo=e38.co.us.ibm.com; Received: from e38.co.us.ibm.com ([32.97.110.159]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NVBCH-00037I-C4 for v9fs-developer@lists.sourceforge.net; Wed, 13 Jan 2010 21:56:14 +0000 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e38.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o0DLZ39e027015 for ; Wed, 13 Jan 2010 14:35:03 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o0DLdtNO179036 for ; Wed, 13 Jan 2010 14:39:55 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o0DLds9a031370 for ; Wed, 13 Jan 2010 14:39:54 -0700 Received: from localhost.localdomain (arlx077.austin.ibm.com [9.3.61.77]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o0DLdrCF031303; Wed, 13 Jan 2010 14:39:54 -0700 From: ericvh@gmail.com To: v9fs-developer@lists.sourceforge.net Date: Wed, 13 Jan 2010 15:39:53 -0600 Message-Id: <1263418793-31582-2-git-send-email-ericvh@gmail.com> X-Mailer: git-send-email 1.5.5 In-Reply-To: <1263418793-31582-1-git-send-email-ericvh@gmail.com> References: <1263418793-31582-1-git-send-email-ericvh@gmail.com> X-Spam-Score: -2.8 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [32.97.110.159 listed in list.dnswl.org] 1.2 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) X-Headers-End: 1NVBCH-00037I-C4 Cc: Eric Van Hensbergen Subject: [V9fs-developer] [PATCH] net/9p: fail when user specifies a transport which we can't find X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net 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; }