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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y9FTURnqROHP5UUa@swahl-home.5wahls.com>
Date:   Wed, 25 Jan 2023 10:05:37 -0600
From:   Steve Wahl <steve.wahl@....com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     Steve Wahl <steve.wahl@....com>,
        Dimitri Sivanich <dimitri.sivanich@....com>,
        Russ Anderson <russ.anderson@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] x86/platform/uv: UV support for sub-NUMA clustering

On Wed, Jan 25, 2023 at 12:28:07PM +0100, Ingo Molnar wrote:
> 
> * Steve Wahl <steve.wahl@....com> wrote:
> 
> > +static int __init alloc_conv_table(int num_elem, unsigned short **table)
> > +{
> > +	int i;
> > +	size_t bytes;
> > +
> > +	bytes = num_elem * sizeof(*table[0]);
> > +	*table = kmalloc(bytes, GFP_KERNEL);
> > +	WARN_ON_ONCE(!*table);
> > +	if (!*table)
> > +		return -ENOMEM;
> 
> WARN_ON_ONCE() is pass-through on the condition, so you can write this in a 
> shorter form:
> 
> 	if (!WARN_ON_ONCE(!*table))
> 		return -ENOMEM;

That is nicer.  I will incorporate this (including all the repeats).

...
> 
> > +		WARN_ON_ONCE(!new_hub);
> > +		if (!new_hub)
> > +			return;
> 
> Same. Also a memory leak of at least uv_hub_info_list_blade?

You're right, and this is not the only place.  I will rework.

...
> > +
> > +	for_each_node(nodeid) {
> > +		__uv_hub_info_list[nodeid] = uv_hub_info_list_blade[uv_node_to_blade_id(nodeid)];
> > +	}
> 
> Unnecessary curly braces.

I will fix.

> Looks good otherwise - presumably it's both tested and backwards compatible 
> with older UV hardware?

Yes, in fact there was a major re-work before letting it escape to the
world because the previous version didn't function on older hardware.

Thank you for taking the time to review!

--> Steve
-- 
Steve Wahl, Hewlett Packard Enterprise

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ