From: Alexander Aring Date: Thu, 27 Aug 2020 15:02:54 -0400 Subject: [Cluster-devel] [PATCH dlm/next 7/7] fs: dlm: use free_con to free connection In-Reply-To: <20200827190254.719333-1-aahringo@redhat.com> References: <20200827190254.719333-1-aahringo@redhat.com> Message-ID: <20200827190254.719333-8-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch use free_con() functionality to free the listen connection if listen fails. It also fixes an issue that a freed resource is still part of the connection_hash as hlist_del() is not called in this case. The only difference is that free_con() handles othercon as well, but this is never been set for the listen connection. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 794216eb728c..1bf1808bfa6b 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1704,10 +1704,8 @@ int dlm_lowcomms_start(void) fail_unlisten: dlm_allow_conn = 0; con = nodeid2con(0,0); - if (con) { - close_connection(con, false, true, true); - kfree_rcu(con, rcu); - } + if (con) + free_conn(con); fail: return error; } -- 2.26.2