From: Adrian Bunk Date: Tue, 14 Mar 2006 05:20:47 +0000 (-0800) Subject: [PATCH] SUNRPC: fix a NULL pointer dereference in net/sunrpc/clnt.c X-Git-Tag: v2.6.16~41 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=712917d1c002f820b177683f4fd491289bde3c32;p=linux-2.6-omap-h63xx.git [PATCH] SUNRPC: fix a NULL pointer dereference in net/sunrpc/clnt.c The Coverity checker spotted this possible NULL pointer dereference in rpc_new_client(). Signed-off-by: Adrian Bunk Signed-off-by: Trond Myklebust Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d2f0550c4ba..d7847978204 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -113,7 +113,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, err = -EINVAL; if (!xprt) - goto out_err; + goto out_no_xprt; if (vers >= program->nrvers || !(version = program->version[vers])) goto out_err; @@ -182,6 +182,7 @@ out_no_path: kfree(clnt); out_err: xprt_destroy(xprt); +out_no_xprt: return ERR_PTR(err); }