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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4513C9BF.7040706@grupopie.com>
Date:	Fri, 22 Sep 2006 12:32:15 +0100
From:	Paulo Marques <pmarques@...popie.com>
To:	Jiri Slaby <jirislaby@...il.com>
CC:	Om Narasimhan <om.turyx@...il.com>, linux-kernel@...r.kernel.org,
	kernel-janitors@...ts.osdl.org
Subject: Re: [KJ] kmalloc to kzalloc patches for drivers/block [sane version]

Jiri Slaby wrote:
> Om Narasimhan wrote:
>> [...]
>> --- a/drivers/block/cpqarray.c
>> +++ b/drivers/block/cpqarray.c
>> @@ -424,7 +424,7 @@ static int __init cpqarray_register_ctlr
>>     hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent(
>>         hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t),
>>         &(hba[i]->cmd_pool_dhandle));
>> -    hba[i]->cmd_pool_bits = kmalloc(
>> +    hba[i]->cmd_pool_bits = kzalloc(
>>         ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long),
>>         GFP_KERNEL);
> 
> kcalloc?

Agreed on every comment except this one. That complex expression is 
really just a constant in the end, so there is no point in using kcalloc.

-- 
Paulo Marques - www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ