lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID:
 <OSZPR01MB87985042129BAD34812742F48B50A@OSZPR01MB8798.jpnprd01.prod.outlook.com>
Date: Fri, 18 Jul 2025 05:55:01 +0000
From: "Shaopeng Tan (Fujitsu)" <tan.shaopeng@...itsu.com>
To: "x86@...nel.org" <x86@...nel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
CC: Reinette Chatre <reinette.chatre@...el.com>, James Morse
	<james.morse@....com>, Yury Norov <yury.norov@...il.com>, Dave Martin
	<dave.martin@....com>, "fenghuay@...dia.com" <fenghuay@...dia.com>,
	"peternewman@...gle.com" <peternewman@...gle.com>, Babu Moger
	<Babu.Moger@....com>, Borislav Petkov <bp@...en8.de>,
	"shameerali.kolothum.thodi@...wei.com"
	<shameerali.kolothum.thodi@...wei.com>, "bobo.shaobowang@...wei.com"
	<bobo.shaobowang@...wei.com>, D Scott Phillips OS
	<scott@...amperecomputing.com>, "carl@...amperecomputing.com"
	<carl@...amperecomputing.com>, Shanker Donthineni <sdonthineni@...dia.com>,
	Xin Hao <xhao@...ux.alibaba.com>, "baolin.wang@...ux.alibaba.com"
	<baolin.wang@...ux.alibaba.com>, "lcherian@...vell.com"
	<lcherian@...vell.com>, "amitsinght@...vell.com" <amitsinght@...vell.com>,
	Ingo Molnar <mingo@...hat.com>, David Hildenbrand <david@...hat.com>, H Peter
 Anvin <hpa@...or.com>, Rex Nie <rex.nie@...uarmicro.com>, Jamie Iles
	<quic_jiles@...cinc.com>, "dfustini@...libre.com" <dfustini@...libre.com>,
	Thomas Gleixner <tglx@...utronix.de>, 'Koba Ko' <kobak@...dia.com>,
	"x86@...nel.org" <x86@...nel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] fs/resctrl: Optimize code in rdt_get_tree()

Hello Reinette,

Do you have any other comments?

> 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@...fujitsu.com>
> Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
> Reviewed-by: James Morse <james.morse@....com>
> ---
>  fs/resctrl/rdtgroup.c | 7 ++-----
>  1 file 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 @@ static int rdt_get_tree(struct fs_context *fc)
>  	closid_exit();
>  out_schemata_free:
>  	schemata_list_destroy();
> -out_ctx:
>  	rdt_disable_ctx();
>  out_root:
>  	rdtgroup_destroy_root();
> --
> 2.43.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ