diff mbox series

btrfs: remove redundant code

Message ID FBF470E1-D893-4AC1-B7E7-4F1CC33020A9@tencent.com (mailing list archive)
State New, archived
Headers show
Series btrfs: remove redundant code | expand

Commit Message

flyingpeng(彭浩) Sept. 18, 2022, 7:26 a.m. UTC
Since leaf is already NULL, and no other branch will go fail_unlock,
the fail_unlock branch is useless.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 fs/btrfs/disk-io.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.27.0
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4c3166f3c725..f39165aec175 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1284,7 +1284,7 @@  struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
        if (IS_ERR(leaf)) {
                ret = PTR_ERR(leaf);
                leaf = NULL;
-               goto fail_unlock;
+               goto fail;
        }

        root->node = leaf;
@@ -1319,9 +1319,6 @@  struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,

        return root;

-fail_unlock:
-       if (leaf)
-               btrfs_tree_unlock(leaf);
 fail:
        btrfs_put_root(root);