iommu/dma: Use kvcalloc() instead of kvzalloc()
Subsystems (2)
PATCH 1/1 iommu/dma: Use kvcalloc() instead of kvzalloc()
Use 2-factor argument form kvcalloc() instead of kvzalloc().
--- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dma-iommu.c +1 -1
@@ -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 ;
Signature · 1 line
2.27.0
Quoted 4 lines · Gustavo A. R. Silva
Use 2-factor argument form
kvcalloc()instead ofkvzalloc().
Looks right.
Reviewed-by Kees Cook <[email protected]>
Signature · 1 line
Kees Cook
Quoted 1 line · Gustavo A. R. Silva
Use 2-factor argument form
kvcalloc()instead ofkvzalloc().
If we have a thing for that now, then sure, why not. FWIW this can't ever overflow due to where "count" comes from, but it has no reason to be special.
Acked-by Robin Murphy <[email protected]>
Quoted 20 lines
--- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/dma-iommu.c +1
-1@@ -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 ;
Quoted 7 lines · Gustavo A. R. Silva
Use 2-factor argument form
kvcalloc()instead ofkvzalloc().--- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu