From: Wang ShaoBo bobo.shaobowang@huawei.com
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: 7e9b5caeefff ("arm64/mpam: resctrl: Add helpers for init and destroy schemata list") Signed-off-by: Wang ShaoBo bobo.shaobowang@huawei.com Reviewed-by: Jian Cheng cj.chengjian@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/resctrlfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/resctrlfs.c b/fs/resctrlfs.c index cfa09344ad5d..8b9803ffa6e6 100644 --- a/fs/resctrlfs.c +++ b/fs/resctrlfs.c @@ -372,13 +372,13 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, ret = resctrl_id_init(); if (ret) { dentry = ERR_PTR(ret); - goto out_options; + goto out_schema; }
ret = resctrl_group_create_info_dir(resctrl_group_default.kn, &kn_info); if (ret) { dentry = ERR_PTR(ret); - goto out_options; + goto out_schema; }
if (resctrl_mon_capable) { @@ -425,6 +425,8 @@ static struct dentry *resctrl_mount(struct file_system_type *fs_type, kernfs_remove(kn_mongrp); out_info: kernfs_remove(kn_info); +out_schema: + schemata_list_destroy(); out_options: release_resctrl_group_fs_options(); out: