[Ocfs2-tools-devel] [PATCH 12/15] dx_dirs v10: fix return value of walk_dirblock() when enable metaecc
Coly Li
coly.li at suse.de
Wed Mar 24 12:51:53 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>
---
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;
--
Coly Li
SuSE Labs
More information about the Ocfs2-tools-devel
mailing list