Skip to content

Commit

Permalink
[PATCH] SUNRPC: fix a NULL pointer dereference in net/sunrpc/clnt.c
Browse files Browse the repository at this point in the history
The Coverity checker spotted this possible NULL pointer dereference in
rpc_new_client().

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Mar 14, 2006
1 parent 143f412 commit 712917d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -182,6 +182,7 @@ rpc_new_client(struct rpc_xprt *xprt, char *servname,
kfree(clnt);
out_err:
xprt_destroy(xprt);
out_no_xprt:
return ERR_PTR(err);
}

Expand Down

0 comments on commit 712917d

Please sign in to comment.