From: Ben Hutchings Date: Tue, 22 Feb 2011 21:54:34 +0000 (+0000) Subject: sunrpc: Propagate errors from xs_bind() through xs_create_sock() X-Git-Tag: firefly_0821_release~7613^2~2171^2~63 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4cea288aaf0e11647880cc487350b1dc45d9febc;p=firefly-linux-kernel-4.4.55.git sunrpc: Propagate errors from xs_bind() through xs_create_sock() 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 Cc: stable@kernel.org [v2.6.37] Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index c431f5a57960..be96d429b475 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -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; }