Skip to content

Commit

Permalink
Btrfs: uninitialized data is check_path_shared()
Browse files Browse the repository at this point in the history
refs can be used with uninitialized data if btrfs_lookup_extent_info()
fails on the first pass through the loop.  In the original code if that
happens then check_path_shared() probably returns 1, this patch
changes it to return 1 for safety.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Jun 11, 2010
1 parent 8360977 commit 0e4dcbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2673,7 +2673,7 @@ static int check_path_shared(struct btrfs_root *root,
struct extent_buffer *eb;
int level;
int ret;
u64 refs;
u64 refs = 1;

for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
if (!path->nodes[level])
Expand Down

0 comments on commit 0e4dcbe

Please sign in to comment.