Btrfs: fix invalid reference in replace_path
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 21 Mar 2016 21:59:53 +0000 (14:59 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Apr 2016 14:29:18 +0000 (16:29 +0200)
Dan Carpenter's static checker has found this error, it's introduced by
commit 64c043de466d
("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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c

index 2bd0011450df2715ca926a6ccd2d99cb7d40f8b4..5c806f0d443ddf59bb3829a3c79aab267526a0a1 100644 (file)
@@ -1850,6 +1850,7 @@ again:
                        eb = read_tree_block(dest, old_bytenr, old_ptr_gen);
                        if (IS_ERR(eb)) {
                                ret = PTR_ERR(eb);
+                               break;
                        } else if (!extent_buffer_uptodate(eb)) {
                                ret = -EIO;
                                free_extent_buffer(eb);