Skip to content

Commit

Permalink
sunrpc: Propagate errors from xs_bind() through xs_create_sock()
Browse files Browse the repository at this point in the history
xs_create_sock() is supposed to return a pointer or an ERR_PTR-encoded
error, but it currently returns 0 if xs_bind() fails.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org [v2.6.37]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Ben Hutchings authored and Trond Myklebust committed Mar 10, 2011
1 parent 3fa0b4e commit 4cea288
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,8 @@ static struct socket *xs_create_sock(struct rpc_xprt *xprt,
}
xs_reclassify_socket(family, sock);

if (xs_bind(transport, sock)) {
err = xs_bind(transport, sock);
if (err) {
sock_release(sock);
goto out;
}
Expand Down

0 comments on commit 4cea288

Please sign in to comment.