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] [day] [month] [year] [list]
Message-ID: <e8a8404b-b524-4d9e-b0de-d743acf8d7b4@web.de>
Date: Wed, 20 Aug 2025 16:34:15 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Qianfeng Rong <rongqianfeng@...o.com>, linux-rdma@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, Cheng Xu
 <chengyou@...ux.alibaba.com>, Jason Gunthorpe <jgg@...pe.ca>,
 Kai Shen <kaishen@...ux.alibaba.com>, Leon Romanovsky <leon@...nel.org>,
 Liao Yuanhong <liaoyuanhong@...o.com>
Subject: Re: [PATCH] RDMA/erdma: Use vcalloc() instead of vzalloc()

> Replace vzalloc() with vcalloc() in vmalloc_to_dma_addrs(). …



…
> +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
> @@ -671,7 +671,7 @@ static u32 vmalloc_to_dma_addrs(struct erdma_dev *dev, dma_addr_t **dma_addrs,
>  
>  	npages = (PAGE_ALIGN((u64)buf + len) - PAGE_ALIGN_DOWN((u64)buf)) >>
>  		 PAGE_SHIFT;
> -	pg_dma = vzalloc(npages * sizeof(dma_addr_t));
> +	pg_dma = vcalloc(npages, sizeof(dma_addr_t));
…

How do you think about to adjust also the size determination?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.17-rc2#n944

	pg_dma = vcalloc(npages, sizeof(*pg_dma));


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ