[08/87] sunrpc: Propagate errors from xs_bind() through xs_create_sock()

From: Greg KH
Date: Mon Mar 21 2011 - 19:53:42 EST

2.6.37-stable review patch. If anyone has any objections, please let us know.


From: Ben Hutchings <bhutchings@xxxxxxxxxxxxxx>

commit 4cea288aaf0e11647880cc487350b1dc45d9febc upstream.

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@xxxxxxxxxxxxxx>
Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

net/sunrpc/xprtsock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1631,7 +1631,8 @@ static struct socket *xs_create_sock(str
xs_reclassify_socket(family, sock);

- if (xs_bind(transport, sock)) {
+ err = xs_bind(transport, sock);
+ if (err) {
goto out;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/