All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] iommu/dma: Use kvcalloc() instead of kvzalloc()
@ 2021-09-28 22:22 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 8+ messages in thread
From: Gustavo A. R. Silva @ 2021-09-28 22:22 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon
  Cc: iommu, linux-kernel, Gustavo A. R. Silva, linux-hardening

Use 2-factor argument form kvcalloc() instead of kvzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/iommu/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 896bea04c347..18c6edbe5fbf 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -616,7 +616,7 @@ static struct page **__iommu_dma_alloc_pages(struct device *dev,
 	if (!order_mask)
 		return NULL;
 
-	pages = kvzalloc(count * sizeof(*pages), GFP_KERNEL);
+	pages = kvcalloc(count, sizeof(*pages), GFP_KERNEL);
 	if (!pages)
 		return NULL;
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-27  8:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-28 22:22 [PATCH][next] iommu/dma: Use kvcalloc() instead of kvzalloc() Gustavo A. R. Silva
2021-09-28 22:22 ` Gustavo A. R. Silva
2021-10-21 17:01 ` Kees Cook
2021-10-21 17:01   ` Kees Cook
2021-10-21 17:50 ` Robin Murphy
2021-10-21 17:50   ` Robin Murphy
2021-10-27  8:05 ` Joerg Roedel
2021-10-27  8:05   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.