]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix uninitialized variable warning
authorDavid Sterba <dsterba@suse.cz>
Fri, 3 Jun 2011 14:29:08 +0000 (16:29 +0200)
committerChris Mason <chris.mason@oracle.com>
Sat, 4 Jun 2011 12:11:38 +0000 (08:11 -0400)
commit831b26d479b716f1164e827b443dbc2f02f7053e
tree0139c403353d9e1ab771fc7c9049e5c334329d17
parent6c21400df598d1a7021d6d1d3da84c4e168006de
btrfs: fix uninitialized variable warning

With Linus' tree, today's linux-next build (powercp ppc64_defconfig)
produced this warning:

fs/btrfs/delayed-inode.c: In function 'btrfs_delayed_update_inode':
fs/btrfs/delayed-inode.c:1598:6: warning: 'ret' may be used
uninitialized in this function

Introduced by commit 7aeec0c34a09 ("btrfs: implement delayed inode items
operation").

This fixes a bug in btrfs_update_inode(): if the returned value from
btrfs_delayed_update_inode is a nonzero garbage, inode stat data are not
updated and several call paths may hit a BUG_ON or fail with strange
code.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David Sterba <dsterba@suse.cz>
fs/btrfs/delayed-inode.c