diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-10-21 13:36:55 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-18 19:20:28 +0100 |
commit | 8266c23124c14e1f6f6fceb320a4c07edbda7132 (patch) | |
tree | 6ff011c5f8368f084c23d819a64174a81b7191df | |
parent | 062c9b04f6ebc27ffb84684792ae3b029b8d0b9a (diff) | |
download | linux-stable-8266c23124c14e1f6f6fceb320a4c07edbda7132.tar.gz linux-stable-8266c23124c14e1f6f6fceb320a4c07edbda7132.tar.bz2 linux-stable-8266c23124c14e1f6f6fceb320a4c07edbda7132.zip |
btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
commit 468600c6ec28613b756193c5f780aac062f1acdf upstream.
There is one error handling path that does not free ref, which may cause
a minor memory leak.
CC: stable@vger.kernel.org # 4.19+
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/btrfs/ref-verify.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index 9a2f15f4c80e..bbd63535965c 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -851,6 +851,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; } |