From: Trond Myklebust Subject: Re: [patch] sunrpc: add missing return statement Date: Tue, 04 May 2010 08:27:22 -0400 Message-ID: <1272976042.7559.24.camel@localhost.localdomain> References: <20100504115759.266396633@emlix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: "David S. Miller" , Alexandros Batsakis , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Johannes Weiner Return-path: In-Reply-To: <20100504115759.266396633@emlix.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Tue, 2010-05-04 at 13:59 +0200, Johannes Weiner wrote: > f300bab "nfsd41: sunrpc: add new xprt class for nfsv4.1 backchannel" > introduced an error case branch that lacks an actual `return' keyword > before the return value. Add it. > > Signed-off-by: Johannes Weiner > Cc: Alexandros Batsakis > --- > net/sunrpc/xprtsock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/net/sunrpc/xprtsock.c > +++ b/net/sunrpc/xprtsock.c > @@ -2444,7 +2444,7 @@ static struct rpc_xprt *xs_setup_bc_tcp( > struct svc_sock *bc_sock; > > if (!args->bc_xprt) > - ERR_PTR(-EINVAL); > + return ERR_PTR(-EINVAL); > > xprt = xs_setup_xprt(args, xprt_tcp_slot_table_entries); > if (IS_ERR(xprt)) No. It should either be a BUG_ON(), or else be removed entirely. Returning an error value for something that is clearly a programming bug is not a particularly useful exercise... Cheers Trond