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] [PATCH] dlm_controld: init plocks_data to zero
Date: Tue, 21 Mar 2023 10:51:54 -0400	[thread overview]
Message-ID: <20230321145154.2222461-1-aahringo@redhat.com> (raw)

Inits plocks_data to zero in case of send_all_plocks_data() does not set
plocks_data to any value or nodes_added() returns false. This patch fixes
cppcheck warning:

cpg.c:1299:27: error: Uninitialized variable: plocks_data [uninitvar]
 send_plocks_done(ls, cg, plocks_data);
---
 dlm_controld/cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c
index b85fef5f..32aad924 100644
--- a/dlm_controld/cpg.c
+++ b/dlm_controld/cpg.c
@@ -1244,8 +1244,8 @@ static int nodes_added(struct lockspace *ls)
 static void prepare_plocks(struct lockspace *ls)
 {
 	struct change *cg = list_first_entry(&ls->changes, struct change, list);
+	uint32_t plocks_data = 0;
 	struct member *memb;
-	uint32_t plocks_data;
 
 	if (!opt(enable_plock_ind) || ls->disable_plock)
 		return;
-- 
2.31.1


                 reply	other threads:[~2023-03-21 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230321145154.2222461-1-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 read-only IMAP folder(s) and NNTP newsgroup(s).