Re: [PATCH][next] scsi: fnic: Replace vmalloc() + memset() with vzalloc() and use array_size()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2020-06-16 at 00:19 +0000, Satish Kharat (satishkh) wrote:
> Reviewed-by: Satish Kharat <satishkh@xxxxxxxxx>
> 
> 
> On 6/15/20, 3:49 PM, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx> wrote:
> 
>     Use vzalloc() instead of the vmalloc() and memset. Also, use array_size()
>     instead of the open-coded version.
>     
>     This issue was found with the help of Coccinelle and, audited and fixed
>     manually.
>     
>     Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
>     Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
>     ---
>      drivers/scsi/fnic/fnic_trace.c | 16 ++++------------
>      1 file changed, 4 insertions(+), 12 deletions(-)
>     
>     diff --git a/drivers/scsi/fnic/fnic_trace.c b/drivers/scsi/fnic/fnic_trace.c
[]
>     @@ -488,7 +488,7 @@ int fnic_trace_buf_init(void)
>      	}
>      
>      	fnic_trace_entries.page_offset =
>     -		vmalloc(array_size(fnic_max_trace_entries,
>     +		vzalloc(array_size(fnic_max_trace_entries,
>      				   sizeof(unsigned long)));

Perhaps better as
		kvcalloc(fnic_max_trace_entries, sizeof(unsigned long),
			 GFP_KERNEL);





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux