提交 10e4e43b 编写于 作者: W Wang ShaoBo 提交者: Zheng Zengkai

arm64/mpam: resctrl: Add proper error handling to resctrl_mount()

hulk inclusion
category: bugfix
bugzilla: 48265
CVE: NA

--------------------------------

This function is called only when we mount resctrl sysfs, for error
handling we need to destroy schemata list when next few steps failed
after creation of schemata list.

Fixes: 7e9b5caeefff ("arm64/mpam: resctrl: Add helpers for init and destroy schemata list")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 100e2317
......@@ -404,11 +404,11 @@ static int resctrl_get_tree(struct fs_context *fc)
ret = resctrl_id_init();
if (ret)
goto out;
goto out_schema;
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info);
if (ret)
goto out;
goto out_schema;
if (resctrl_mon_capable) {
ret = mongroup_create_dir(resctrl_group_default.kn,
......@@ -450,6 +450,8 @@ static int resctrl_get_tree(struct fs_context *fc)
kernfs_remove(kn_mongrp);
out_info:
kernfs_remove(kn_info);
out_schema:
schemata_list_destroy();
out:
rdt_last_cmd_clear();
mutex_unlock(&resctrl_group_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册