cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] dlm_controld: init plocks_data to zero
@ 2023-03-21 14:51 Alexander Aring
  0 siblings, 0 replies; only message in thread
From: Alexander Aring @ 2023-03-21 14:51 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-21 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 14:51 [Cluster-devel] [PATCH] dlm_controld: init plocks_data to zero Alexander Aring

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).