提交 93363a49 编写于 作者: L Lin Yi 提交者: Xie XiuQi

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

[ Upstream commit b9622614 ]

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: NLin Yi <teroincn@163.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 25e7930a
...@@ -2716,6 +2716,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt, ...@@ -2716,6 +2716,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
xprt = xprt_iter_xprt(&clnt->cl_xpi); xprt = xprt_iter_xprt(&clnt->cl_xpi);
if (xps == NULL || xprt == NULL) { if (xps == NULL || xprt == NULL) {
rcu_read_unlock(); rcu_read_unlock();
xprt_switch_put(xps);
return -EAGAIN; return -EAGAIN;
} }
resvport = xprt->resvport; resvport = xprt->resvport;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册