From: zhengbin Date: Wed, 13 Mar 2019 08:01:37 +0000 (+0800) Subject: 9p/net: fix memory leak in p9_client_create X-Git-Tag: v4.14.108~182 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1cbd3417c43ab9eab43a0fe909fcd2e4b38668f2;p=users%2Fjedix%2Flinux-maple.git 9p/net: fix memory leak in p9_client_create commit bb06c388fa20ae24cfe80c52488de718a7e3a53f upstream. 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: Hulk Robot Signed-off-by: zhengbin Signed-off-by: Dominique Martinet Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/9p/client.c b/net/9p/client.c index ef0f8fe3ac08f..6a6b290574a12 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1082,7 +1082,7 @@ struct p9_client *p9_client_create(const char *dev_name, char *options) p9_debug(P9_DEBUG_ERROR, "Please specify a msize of at least 4k\n"); err = -EINVAL; - goto free_client; + goto close_trans; } err = p9_client_version(clnt);