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>
This commit is contained in:
parent
a6f498a891
commit
2aa13531bb
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue