Commit 712917d1 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 143f412e
...@@ -113,7 +113,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, ...@@ -113,7 +113,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
err = -EINVAL; err = -EINVAL;
if (!xprt) if (!xprt)
goto out_err; goto out_no_xprt;
if (vers >= program->nrvers || !(version = program->version[vers])) if (vers >= program->nrvers || !(version = program->version[vers]))
goto out_err; goto out_err;
...@@ -182,6 +182,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname, ...@@ -182,6 +182,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
kfree(clnt); kfree(clnt);
out_err: out_err:
xprt_destroy(xprt); xprt_destroy(xprt);
out_no_xprt:
return ERR_PTR(err); return ERR_PTR(err);
} }
......
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