cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/2] gfs2_edit savemeta: Fix use of uninitialized 'blk'
Date: Tue, 10 May 2016 15:43:11 +0100	[thread overview]
Message-ID: <1462891391-19942-2-git-send-email-anprice@redhat.com> (raw)
In-Reply-To: <1462891391-19942-1-git-send-email-anprice@redhat.com>

Fixes
  "savemeta.c:737:14: warning: ?blk? may be used uninitialized in this function"

blk is never actually used uninitialized here but the compiler can't
reason it out, so make it explicit to silence the warning.

Signed-off-by: Andrew Price <anprice@redhat.com>
---
 gfs2/edit/savemeta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 8510d77..db9a947 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -712,7 +712,7 @@ static void get_journal_inode_blocks(void)
 static void save_allocated(struct rgrp_tree *rgd, struct metafd *mfd)
 {
 	int blktype;
-	uint64_t blk;
+	uint64_t blk = 0;
 	unsigned i, j, m;
 	uint64_t *ibuf = malloc(sbd.bsize * GFS2_NBBY * sizeof(uint64_t));
 
-- 
2.4.11



      reply	other threads:[~2016-05-10 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 14:43 [Cluster-devel] [PATCH 1/2] fsck.gfs2: Fix a potential memory leak in pass3 Andrew Price
2016-05-10 14:43 ` Andrew Price [this message]

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=1462891391-19942-2-git-send-email-anprice@redhat.com \
    --to=anprice@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).