Commit bb06c388 authored by zhengbin's avatar zhengbin Committed by Dominique Martinet

9p/net: fix memory leak in p9_client_create

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: 574d356b ("9p/net: put a lower bound on msize")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarzhengbin <zhengbin13@huawei.com>
Signed-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
parent 5e3cc1ee
...@@ -1061,7 +1061,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options) ...@@ -1061,7 +1061,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment