提交 2aa13531 编写于 作者: S Stanislav Kinsbursky 提交者: Trond Myklebust

SUNRPC: destroy freshly allocated transport in case of sockaddr init error

Otherwise we will leak xprt structure and struct net reference.
Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 a6f498a8
...@@ -2530,8 +2530,10 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args, ...@@ -2530,8 +2530,10 @@ static struct rpc_xprt *xs_setup_xprt(struct xprt_create *args,
int err; int err;
err = xs_init_anyaddr(args->dstaddr->sa_family, err = xs_init_anyaddr(args->dstaddr->sa_family,
(struct sockaddr *)&new->srcaddr); (struct sockaddr *)&new->srcaddr);
if (err != 0) if (err != 0) {
xprt_free(xprt);
return ERR_PTR(err); return ERR_PTR(err);
}
} }
return xprt; return xprt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册