Patchwork [3/3] ext4: initialize 'error' variable in ext4_xattr_block_find()

login
register
mail settings
Submitter Zheng Liu
Date Nov. 7, 2011, 1:32 p.m.
Message ID <1320672724-4432-4-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/124076/
State Rejected
Headers show

Comments

Zheng Liu - Nov. 7, 2011, 1:32 p.m.
From: Zheng Liu <wenqing.lz@taobao.com>

'error' variable is initialized to 0 to avoid a assignment in
ext4_xattr_block_find().

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 fs/ext4/xattr.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index e985864..bd67d0a 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -652,7 +652,7 @@  ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i,
 		      struct ext4_xattr_block_find *bs)
 {
 	struct super_block *sb = inode->i_sb;
-	int error;
+	int error = 0;
 
 	ea_idebug(inode, "name=%d.%s, value=%p, value_len=%ld",
 		  i->name_index, i->name, i->value, (long)i->value_len);
@@ -684,7 +684,6 @@  ext4_xattr_block_find(struct inode *inode, struct ext4_xattr_info *i,
 			goto cleanup;
 		bs->s.not_found = error;
 	}
-	error = 0;
 
 cleanup:
 	return error;