cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCHv2 dlm/next 1/3] fs: dlm: cleanup dlm_local_addr properly
Date: Tue, 20 Oct 2020 20:17:37 -0400	[thread overview]
Message-ID: <20201021001739.1689219-2-aahringo@redhat.com> (raw)
In-Reply-To: <20201021001739.1689219-1-aahringo@redhat.com>

This patch assigns the dlm_local_addr entries to NULL after we freeing
the memory of the entry. This is 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 <aahringo@redhat.com>
---
 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



  reply	other threads:[~2020-10-21  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  0:17 [Cluster-devel] [PATCHv2 dlm/next 0/3] fs: dlm: node address configuration fixes Alexander Aring
2020-10-21  0:17 ` Alexander Aring [this message]
2020-10-21  0:17 ` [Cluster-devel] [PATCHv2 dlm/next 2/3] fs: dlm: constify addr_compare Alexander Aring
2020-10-21  0:17 ` [Cluster-devel] [PATCHv2 dlm/next 3/3] fs: dlm: check on existing node address Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201021001739.1689219-2-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).