mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
net :sunrpc :clnt :Fix xps refcount imbalance on the error path
[ Upstream commit b962261484 ]
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: Lin Yi <teroincn@163.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
810cfc3d9d
commit
e9f76b9543
@@ -2713,6 +2713,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;
|
||||
|
||||
Reference in New Issue
Block a user