[Ocfs2-tools-devel] [PATCH 12/15] dx_dirs v11: fix return value of walk_dirblock() when enable metaecc

Coly Li coly.li at suse.de
Sun Apr 11 01:10:09 PDT 2010


If there is no error, the return value 'ret' might be used with
undefined initial value. This patch fixes the error by initiating
it to 0.

Reported-by: Vit Pelcak <vpelcak at novell.com>
Signed-off-by: Coly Li <coly.li at suse.de>
Acked-by: Mark Fasheh <mfasheh at suse.com>
---
 tunefs.ocfs2/feature_metaecc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tunefs.ocfs2/feature_metaecc.c b/tunefs.ocfs2/feature_metaecc.c
index c4de8be..799b404 100644
--- a/tunefs.ocfs2/feature_metaecc.c
+++ b/tunefs.ocfs2/feature_metaecc.c
@@ -135,7 +135,7 @@ static errcode_t walk_dirblock(ocfs2_filesys *fs,
 			       struct tunefs_trailer_context *tc,
 			       struct tunefs_trailer_dirblock *db)
 {
-	errcode_t ret;
+	errcode_t ret = 0;
 	struct ocfs2_dir_entry *dirent, *prev = NULL;
 	unsigned int real_rec_len;
 	unsigned int offset = 0;
-- 
1.7.0.2




More information about the Ocfs2-tools-devel mailing list