diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-10-21 13:36:55 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-11-05 13:03:39 +0100 |
commit | 468600c6ec28613b756193c5f780aac062f1acdf (patch) | |
tree | 87ab36c8d91d167ea9a7dfb26732349db83eca9f /fs/btrfs | |
parent | cf89af146b7e62af55470cf5f3ec3c56ec144a5e (diff) | |
download | linux-468600c6ec28613b756193c5f780aac062f1acdf.tar.bz2 |
btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
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>
Diffstat (limited to 'fs/btrfs')
-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 7f03dbe5b609..78693d3dd15b 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -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; } |