gfs2-utils: master - gfs2-utils: Fix some uninitialized variable warnings

Andrew Price andyp at fedoraproject.org
Fri May 31 12:30:04 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=98af5fe66d6a82dbf8aa4ca41d987ba005299c1e
Commit:        98af5fe66d6a82dbf8aa4ca41d987ba005299c1e
Parent:        f1c446c04f3a3405a5123f50e64c8e2f8007b064
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Fri May 31 13:28:34 2013 +0100
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Fri May 31 13:28:34 2013 +0100

gfs2-utils: Fix some uninitialized variable warnings

Initialize two variables to silence -Wmaybe-uninitialized warnings

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/convert/gfs2_convert.c |    2 +-
 gfs2/libgfs2/fs_ops.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index d4bad1d..719ba9c 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1061,7 +1061,7 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
 {
 	struct rgrp_tree *rgd;
 	struct osi_node *n, *next = NULL;
-	uint64_t block;
+	uint64_t block = 0;
 	struct gfs2_buffer_head *bh;
 	int first;
 	int error = 0;
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index d009e2f..36cd789 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -251,7 +251,7 @@ uint64_t dinode_alloc(struct gfs2_sbd *sdp)
 int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno)
 {
 	int ret;
-	struct rgrp_tree *rgt;
+	struct rgrp_tree *rgt = NULL;
 	struct osi_node *n = NULL;
 	for (n = osi_first(&sdp->rgtree); n; n = osi_next(n)) {
 		rgt = (struct rgrp_tree *)n;


More information about the cluster-commits mailing list