Skip to content

Commit

Permalink
ocfs2: Fix compilation warning for fs/ocfs2/xattr.c
Browse files Browse the repository at this point in the history
gcc 4.4.1 generates the following build warning on i386:

CC [M]  fs/ocfs2/xattr.o
fs/ocfs2/xattr.c: In function ‘ocfs2_xattr_block_get’:
fs/ocfs2/xattr.c:1055: warning: ‘block_off’ may be used uninitialized in this function

The following fix is based on a similar approach by David Howells
few days back: http://lkml.org/lkml/2009/7/9/109,

Signed-off-by: Subrata Modak<subrata@linux.vnet.ibm.com>,
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Subrata Modak authored and Joel Becker committed Jul 20, 2009
1 parent cefcb80 commit 44d8e4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,8 @@ static int ocfs2_xattr_block_get(struct inode *inode,
struct ocfs2_xattr_block *xb;
struct ocfs2_xattr_value_root *xv;
size_t size;
int ret = -ENODATA, name_offset, name_len, block_off, i;
int ret = -ENODATA, name_offset, name_len, i;
int uninitialized_var(block_off);

xs->bucket = ocfs2_xattr_bucket_new(inode);
if (!xs->bucket) {
Expand Down

0 comments on commit 44d8e4e

Please sign in to comment.