mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
Btrfs: uninitialized data is check_path_shared()
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>
This commit is contained in:
parent
8360977972
commit
0e4dcbef1c
1 changed files with 1 additions and 1 deletions
|
@ -2673,7 +2673,7 @@ static int check_path_shared(struct btrfs_root *root,
|
||||||
struct extent_buffer *eb;
|
struct extent_buffer *eb;
|
||||||
int level;
|
int level;
|
||||||
int ret;
|
int ret;
|
||||||
u64 refs;
|
u64 refs = 1;
|
||||||
|
|
||||||
for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
|
for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
|
||||||
if (!path->nodes[level])
|
if (!path->nodes[level])
|
||||||
|
|
Loading…
Add table
Reference in a new issue