Commit 24469ab4 authored by Liu Bo's avatar Liu Bo Committed by Greg Kroah-Hartman

Btrfs: fix invalid reference in replace_path

commit 264813ac upstream.

Dan Carpenter's static checker has found this error, it's introduced by
commit 64c043de
("Btrfs: fix up read_tree_block to return proper error")

It's really supposed to 'break' the loop on error like others.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b96513cc
...@@ -1850,6 +1850,7 @@ int replace_path(struct btrfs_trans_handle *trans, ...@@ -1850,6 +1850,7 @@ int replace_path(struct btrfs_trans_handle *trans,
eb = read_tree_block(dest, old_bytenr, old_ptr_gen); eb = read_tree_block(dest, old_bytenr, old_ptr_gen);
if (IS_ERR(eb)) { if (IS_ERR(eb)) {
ret = PTR_ERR(eb); ret = PTR_ERR(eb);
break;
} else if (!extent_buffer_uptodate(eb)) { } else if (!extent_buffer_uptodate(eb)) {
ret = -EIO; ret = -EIO;
free_extent_buffer(eb); free_extent_buffer(eb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment