netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9p/net: fix memory leak in p9_client_create
@ 2019-03-13  8:01 zhengbin
  2019-03-13 10:28 ` Dominique Martinet
  0 siblings, 1 reply; 2+ messages in thread
From: zhengbin @ 2019-03-13  8:01 UTC (permalink / raw)
  To: ericvh, lucho, asmadeus, davem, v9fs-developer, netdev; +Cc: houtao1, yi.zhang

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

Fixes: 574d356b7a02 ("9p/net: put a lower bound on msize")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 net/9p/client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 357214a..b85d51f 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1061,7 +1061,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);
--
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] 9p/net: fix memory leak in p9_client_create
  2019-03-13  8:01 [PATCH] 9p/net: fix memory leak in p9_client_create zhengbin
@ 2019-03-13 10:28 ` Dominique Martinet
  0 siblings, 0 replies; 2+ messages in thread
From: Dominique Martinet @ 2019-03-13 10:28 UTC (permalink / raw)
  To: zhengbin; +Cc: ericvh, lucho, davem, v9fs-developer, netdev, houtao1, yi.zhang

zhengbin wrote on Wed, Mar 13, 2019:
> If msize is less than 4096, we should close and put trans, destroy
> tagpool, not just free client. This patch fixes that.
> 
> Fixes: 574d356b7a02 ("9p/net: put a lower bound on msize")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: zhengbin <zhengbin13@huawei.com>

Ack, definitely. Thanks for the fix, I'll take this for 5.1 even if it's
a bit late.

Please do Cc linux-kernel@vger.k.o next time though, that list should
get all the patches.

-- 
Dominique

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-13 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13  8:01 [PATCH] 9p/net: fix memory leak in p9_client_create zhengbin
2019-03-13 10:28 ` Dominique Martinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).