From: Dinghao Liu Date: Wed, 21 Oct 2020 05:36:55 +0000 (+0800) Subject: btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=468600c6ec28613b756193c5f780aac062f1acdf;p=linux.git 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 Signed-off-by: Dinghao Liu Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index 7f03dbe5b609d..78693d3dd15bc 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; }