ocfs2-tools/0012-dx_dirs-fix-return-value-of-walk_dirblock-when-enabl.patch

33 lines
1.1 KiB
Diff

From 183b0b3a12396e838dcb9c1e7dc0423eb3a4fbd5 Mon Sep 17 00:00:00 2001
From: Coly Li <coly.li@suse.de>
Date: Sun, 11 Apr 2010 16:10:09 +0800
Subject: [PATCH 12/30] dx_dirs: fix return value of walk_dirblock() when enable metaecc
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@novell.com>
Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Mark Fasheh <mfasheh@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