From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Aring Date: Tue, 20 Oct 2020 17:09:55 -0400 Subject: [Cluster-devel] [PATCH dlm/next 1/3] fs: dlm: cleanup dlm_local_addr properly In-Reply-To: <20201020210957.1009638-1-aahringo@redhat.com> References: <20201020210957.1009638-1-aahringo@redhat.com> Message-ID: <20201020210957.1009638-2-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 assigns the dlm_local_addr entries to NULL after we freeing the memory of the entry. This required because the user can changed some settings with less addresses than before and a NULL check on start functionality will check on a dangled pointer. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 11e5e92148fda..9973293bfddcd 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1248,8 +1248,10 @@ static void deinit_local(void) { int i; - for (i = 0; i < dlm_local_count; i++) + for (i = 0; i < dlm_local_count; i++) { kfree(dlm_local_addr[i]); + dlm_local_addr[i] = NULL; + } } /* Initialise SCTP socket and bind to all interfaces -- 2.26.2