提交 98648c36 编写于 作者: D Dinghao Liu 提交者: Yang Yingliang

btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod

commit 468600c6 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: NJosef Bacik <josef@toxicpanda.com>
Signed-off-by: NDinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0b9d8896
...@@ -854,6 +854,7 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes, ...@@ -854,6 +854,7 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
"dropping a ref for a root that doesn't have a ref on the block"); "dropping a ref for a root that doesn't have a ref on the block");
dump_block_entry(fs_info, be); dump_block_entry(fs_info, be);
dump_ref_action(fs_info, ra); dump_ref_action(fs_info, ra);
kfree(ref);
kfree(ra); kfree(ra);
goto out_unlock; goto out_unlock;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册