net/sunrpc/clnt.c: fix a NULL pointer dereference
Subsystems (3)
PATCH 1/1 net/sunrpc/clnt.c: fix a NULL pointer dereference
The Coverity checker spotted this possible NULL pointer dereference in rpc_new_client().
Signed-off-by Adrian Bunk <[email protected]>
net/sunrpc/clnt.c renamed from net/sunrpc/clnt.c.old +2 -1
@@ -112,7 +112,7 @@ rpc_new_client(struct rpc_xprt *xprt, ch 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); }