]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - fs/btrfs/ref-verify.c
Merge tag 'linux-kselftest-5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-jammy-kernel.git] / fs / btrfs / ref-verify.c
index b57f3618e58e305f5520dbf7f472df816180b8e4..454a1015d026b741ec1a1b168375755d6df5971a 100644 (file)
@@ -744,6 +744,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
                 */
                be = add_block_entry(fs_info, bytenr, num_bytes, ref_root);
                if (IS_ERR(be)) {
+                       kfree(ref);
                        kfree(ra);
                        ret = PTR_ERR(be);
                        goto out;
@@ -757,6 +758,8 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
                        "re-allocated a block that still has references to it!");
                        dump_block_entry(fs_info, be);
                        dump_ref_action(fs_info, ra);
+                       kfree(ref);
+                       kfree(ra);
                        goto out_unlock;
                }
 
@@ -819,6 +822,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
 "dropping a ref for a existing root that doesn't have a ref on the block");
                                dump_block_entry(fs_info, be);
                                dump_ref_action(fs_info, ra);
+                               kfree(ref);
                                kfree(ra);
                                goto out_unlock;
                        }
@@ -834,6 +838,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
 "attempting to add another ref for an existing ref on a tree block");
                        dump_block_entry(fs_info, be);
                        dump_ref_action(fs_info, ra);
+                       kfree(ref);
                        kfree(ra);
                        goto out_unlock;
                }