summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2020-10-21 07:36:55 +0200
committerDavid Sterba <dsterba@suse.com>2020-11-05 13:03:39 +0100
commit468600c6ec28613b756193c5f780aac062f1acdf (patch)
tree87ab36c8d91d167ea9a7dfb26732349db83eca9f /fs
parentbtrfs: dev-replace: fail mount if we don't have replace item with target device (diff)
downloadlinux-468600c6ec28613b756193c5f780aac062f1acdf.tar.xz
linux-468600c6ec28613b756193c5f780aac062f1acdf.zip
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')
-rw-r--r--fs/btrfs/ref-verify.c1
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;
}