Commit b9622614 authored by Lin Yi's avatar Lin Yi Committed by Anna Schumaker
Browse files

net :sunrpc :clnt :Fix xps refcount imbalance on the error path



rpc_clnt_add_xprt take a reference to struct rpc_xprt_switch, but forget
to release it before return, may lead to a memory leak.

Signed-off-by: default avatarLin Yi <teroincn@163.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 90910519
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2805,6 +2805,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
	xprt = xprt_iter_xprt(&clnt->cl_xpi);
	if (xps == NULL || xprt == NULL) {
		rcu_read_unlock();
		xprt_switch_put(xps);
		return -EAGAIN;
	}
	resvport = xprt->resvport;