From e114be41560b848a1ec77c89bea908316fe9846c Mon Sep 17 00:00:00 2001 From: zhenwei pi Date: Wed, 26 Feb 2020 21:51:04 +0800 Subject: [PATCH] iser: fix memory leak for cm thread If a thread is created without any attr, it works in attached mode. It means that we need run pthread_join to relaim stack of thread. Signed-off-by: zhenwei pi --- lib/iser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/iser.c b/lib/iser.c index 95f95ec..c727be1 100644 --- a/lib/iser.c +++ b/lib/iser.c @@ -198,6 +198,7 @@ iser_free_iser_conn_res(struct iser_conn *iser_conn, bool destroy) if (iser_conn->cmthread) { pthread_cancel(iser_conn->cmthread); + pthread_join(iser_conn->cmthread, NULL); iser_conn->cmthread = 0; }