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: <13d3418f-49d1-d683-48a6-cedbc073d86f@suse.de>
Date:   Tue, 13 Nov 2018 16:53:39 +0100
From:   Johannes Thumshirn <jthumshirn@...e.de>
To:     John Garry <john.garry@...wei.com>,
        Sabyasachi Gupta <sabyasachi.linux@...il.com>,
        satishkh@...co.com, sebaddel@...co.com, kartilak@...co.com,
        jejb@...ux.vnet.ibm.com, martin.petersen@...cle.com
Cc:     jrdr.linux@...il.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, brajeswar.linux@...il.com
Subject: Re: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc

On 13/11/2018 16:44, John Garry wrote:
> On 13/11/2018 15:08, Sabyasachi Gupta wrote:
>> Replaced vmalloc + memset with vzalloc
>>
>> Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@...il.com>
>> ---
>>  drivers/scsi/fnic/fnic_trace.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/fnic/fnic_trace.c
>> b/drivers/scsi/fnic/fnic_trace.c
>> index 8271785..129ab27 100644
>> --- a/drivers/scsi/fnic/fnic_trace.c
>> +++ b/drivers/scsi/fnic/fnic_trace.c
>> @@ -468,14 +468,14 @@ int fnic_trace_buf_init(void)
>>      fnic_max_trace_entries = (trace_max_pages * PAGE_SIZE)/
>>                        FNIC_ENTRY_SIZE_BYTES;
>>
>> -    fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages *
>> PAGE_SIZE));
>> +    fnic_trace_buf_p = (unsigned long)vzalloc((trace_max_pages *
>> +                                PAGE_SIZE));
> 
> If you remove the extra brackets in vzalloc() argument then you may not
> spill onto the next line.

And remove the unnecessary cast. vzalloc() (just like vmalloc()) returns
a void*, so no reason to cast it.

-- 
Johannes Thumshirn                                        SUSE Labs
jthumshirn@...e.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ