summaryrefslogtreecommitdiff
path: root/fs/resctrl
diff options
context:
space:
mode:
authorShaopeng Tan <tan.shaopeng@jp.fujitsu.com>2025-06-23 16:50:50 +0900
committerBorislav Petkov (AMD) <bp@alien8.de>2025-09-15 11:44:01 +0200
commit0e58f6a7dd689c73d67e6a2164b46d4618f2698a (patch)
tree89d1704e9d7b9e18af1fa1975f6ec2b9b5357aa5 /fs/resctrl
parentf83ec76bf285bea5727f478a68b894f5543ca76e (diff)
downloadlinux-0e58f6a7dd689c73d67e6a2164b46d4618f2698a.tar.gz
linux-0e58f6a7dd689c73d67e6a2164b46d4618f2698a.tar.bz2
linux-0e58f6a7dd689c73d67e6a2164b46d4618f2698a.zip
fs/resctrl: Optimize code in rdt_get_tree()
schemata_list_destroy() has to be called if schemata_list_create() fails. rdt_get_tree() calls schemata_list_destroy() in two different ways: directly if schemata_list_create() itself fails and on the exit path via the out_schemata_free goto label. Remove schemata_list_destroy() call on schemata_list_create() failure. Use existing out_schemata_free goto label instead. Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: James Morse <james.morse@arm.com> Reviewed-by: Koba Ko <kobak@nvidia.com> Link: https://lore.kernel.org/20250623075051.3610592-1-tan.shaopeng@jp.fujitsu.com
Diffstat (limited to 'fs/resctrl')
-rw-r--r--fs/resctrl/rdtgroup.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 77d08229d855..5f0b7cfa1cc2 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2608,10 +2608,8 @@ static int rdt_get_tree(struct fs_context *fc)
goto out_root;
ret = schemata_list_create();
- if (ret) {
- schemata_list_destroy();
- goto out_ctx;
- }
+ if (ret)
+ goto out_schemata_free;
ret = closid_init();
if (ret)
@@ -2683,7 +2681,6 @@ out_closid_exit:
closid_exit();
out_schemata_free:
schemata_list_destroy();
-out_ctx:
rdt_disable_ctx();
out_root:
rdtgroup_destroy_root();