提交 62d3e616 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

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

hulk inclusion
category: bugfix
bugzilla: 34278
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: dd781a91 ("arm64/mpam: resctrl: Add helpers for init and destroy schemata list")
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NJian Cheng <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 8139268b
...@@ -372,13 +372,13 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, ...@@ -372,13 +372,13 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
ret = resctrl_id_init(); ret = resctrl_id_init();
if (ret) { if (ret) {
dentry = ERR_PTR(ret); dentry = ERR_PTR(ret);
goto out_options; goto out_schema;
} }
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info); ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info);
if (ret) { if (ret) {
dentry = ERR_PTR(ret); dentry = ERR_PTR(ret);
goto out_options; goto out_schema;
} }
if (resctrl_mon_capable) { if (resctrl_mon_capable) {
...@@ -425,6 +425,8 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, ...@@ -425,6 +425,8 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type,
kernfs_remove(kn_mongrp); kernfs_remove(kn_mongrp);
out_info: out_info:
kernfs_remove(kn_info); kernfs_remove(kn_info);
out_schema:
schemata_list_destroy();
out_options: out_options:
release_resctrl_group_fs_options(); release_resctrl_group_fs_options();
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册