提交 8133ffd0 编写于 作者: W Wenwen Wang 提交者: Xie XiuQi

NFSv4: Fix a memory leak bug

mainline inclusion
from mainline-v5.4
commit 1e672e3644940d83bd94e7cb46bac6bb3627de02
category: bugfix
bugzilla: 23341
CVE: NA

-------------------------------------------------

In nfs4_try_migration(), if nfs4_begin_drain_session() fails, the
previously allocated 'page' and 'locations' are not deallocated, leading to
memory leaks. To fix this issue, go to the 'out' label to free 'page' and
'locations' before returning the error.
Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>

v1->v2: add bugzilla id.
Signed-off-by: NZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f05fa983
......@@ -2073,8 +2073,10 @@ static int nfs4_try_migration(struct nfs_server *server, struct rpc_cred *cred)
}
status = nfs4_begin_drain_session(clp);
if (status != 0)
return status;
if (status != 0) {
result = status;
goto out;
}
status = nfs4_replace_transport(server, locations);
if (status != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册