提交 91264b1b 编写于 作者: Z zhengbin 提交者: Xie XiuQi

9p/net: fix memory leak in p9_client_create

mainline inclusion
from mainline-5.1-rc1
commit bb06c388fa20
category: bugfix
bugzilla: 12795
CVE: NA

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

If msize is less than 4096, we should close and put trans, destroy
tagpool, not just free client. This patch fixes that.

Link: http://lkml.kernel.org/m/1552464097-142659-1-git-send-email-zhengbin13@huawei.com
Cc: stable@vger.kernel.org
Fixes: 574d356b7a02 ("9p/net: put a lower bound on msize")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: Nzhengbin <zhengbin13@huawei.com>
Signed-off-by: NDominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: NZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ad0ce27c
...@@ -1073,7 +1073,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options) ...@@ -1073,7 +1073,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
p9_debug(P9_DEBUG_ERROR, p9_debug(P9_DEBUG_ERROR,
"Please specify a msize of at least 4k\n"); "Please specify a msize of at least 4k\n");
err = -EINVAL; err = -EINVAL;
goto free_client; goto close_trans;
} }
err = p9_client_version(clnt); err = p9_client_version(clnt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册