From: Gustavo A. R. Silva Date: Tue, 28 Sep 2021 22:22:29 +0000 (-0500) Subject: iommu/dma: Use kvcalloc() instead of kvzalloc() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ab6f4b001c8c726b5e0bb01429710dc61f13e24d;p=linux.git iommu/dma: Use kvcalloc() instead of kvzalloc() Use 2-factor argument form kvcalloc() instead of kvzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva Acked-by: Robin Murphy Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20210928222229.GA280355@embeddedor Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 342359727a59a..fffa8721a8f01 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -558,7 +558,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;