btrfs: remove redundant check on ret being non-zero
authorColin Ian King <colin.king@canonical.com>
Tue, 15 Aug 2017 07:51:02 +0000 (08:51 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 18 Aug 2017 14:36:29 +0000 (16:36 +0200)
The error return variable ret is initialized to zero and then is
checked to see if it is non-zero in the if-block that follows it.
It is therefore impossible for ret to be non-zero after the if-block
hence the check is redundant and can be removed.

Detected by CoverityScan, CID#1021040 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c

index 3a11ae63676ea8a299828c18fc772e74e57a07e5..f05fcc67efa6fe4a5f43013d18480a1feea29faf 100644 (file)
@@ -1143,8 +1143,6 @@ again:
                                goto again;
                        }
                        kfree(victim_name);
-                       if (ret)
-                               return ret;
 next:
                        cur_offset += victim_name_len + sizeof(*extref);
                }