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] [thread-next>] [day] [month] [year] [list]
Message-ID: <6970ef1c-dc27-b135-afbb-8b87a3348169@nvidia.com>
Date:   Wed, 22 Mar 2023 12:01:14 +0200
From:   Eli Cohen <elic@...dia.com>
To:     Jakub Kicinski <kuba@...nel.org>, Saeed Mahameed <saeed@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Saeed Mahameed <saeedm@...dia.com>, netdev@...r.kernel.org,
        Tariq Toukan <tariqt@...dia.com>
Subject: Re: [net-next 02/14] lib: cpu_rmap: Use allocator for rmap entries


On 22/03/2023 5:40, Jakub Kicinski wrote:
> On Mon, 20 Mar 2023 10:51:32 -0700 Saeed Mahameed wrote:
>> +static int get_free_index(struct cpu_rmap *rmap)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < rmap->size; i++)
>> +		if (!rmap->obj[i])
>> +			return i;
>> +
>> +	return -1;
> -ENOSPC, why invent a special value ..
Thanks, will fix.
>
>> @@ -295,7 +307,11 @@ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq)
>>   	glue->notify.release = irq_cpu_rmap_release;
>>   	glue->rmap = rmap;
>>   	cpu_rmap_get(rmap);
>> -	glue->index = cpu_rmap_add(rmap, glue);
>> +	rc = cpu_rmap_add(rmap, glue);
>> +	if (rc == -1)
>> +		return -ENOSPC;
> which you then have to convert into an errno ?
>
> Also you leak glue here.
Will fix.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ