summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2011-11-10 14:33:23 +0300
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-11-10 14:50:07 -0500
commit2aa13531bbbc6582874bedfcd853e1058b0fb4f9 (patch)
tree6dc0ad696b49bdf6f68382900775a19fb289bf25 /net/sunrpc
parenta6f498a891c730327645a7afa10c5ae977de6fd8 (diff)
downloadlinux-2aa13531bbbc6582874bedfcd853e1058b0fb4f9.tar.bz2
SUNRPC: destroy freshly allocated transport in case of sockaddr init error
Otherwise we will leak xprt structure and struct net reference. Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtsock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index d7f97ef26590..2d78d95955ab 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2530,8 +2530,10 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
int err;
err = xs_init_anyaddr(args->dstaddr->sa_family,
(struct sockaddr *)&new->srcaddr);
- if (err != 0)
+ if (err != 0) {
+ xprt_free(xprt);
return ERR_PTR(err);
+ }
}
return xprt;