]> Git Repo - linux.git/commitdiff
btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
authorDinghao Liu <[email protected]>
Wed, 21 Oct 2020 05:36:55 +0000 (13:36 +0800)
committerDavid Sterba <[email protected]>
Thu, 5 Nov 2020 12:03:39 +0000 (13:03 +0100)
There is one error handling path that does not free ref, which may cause
a minor memory leak.

CC: [email protected] # 4.19+
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: Dinghao Liu <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
fs/btrfs/ref-verify.c

index 7f03dbe5b609d88090d6c7ae909fad660d8b88b5..78693d3dd15bc1d08eb76766aa00ebf0d42804a0 100644 (file)
@@ -860,6 +860,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
 "dropping a ref for a 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;
                }
This page took 0.055568 seconds and 4 git commands to generate.