Commit 404f9373 authored by Robin Murphy's avatar Robin Murphy Committed by Christoph Hellwig

swiotlb: simplify array allocation

Prefer kcalloc() to kzalloc(array_size()) for allocating an array.
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent c0a4191c
...@@ -818,8 +818,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem, ...@@ -818,8 +818,7 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
if (!mem) if (!mem)
return -ENOMEM; return -ENOMEM;
mem->slots = kzalloc(array_size(sizeof(*mem->slots), nslabs), mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL);
GFP_KERNEL);
if (!mem->slots) { if (!mem->slots) {
kfree(mem); kfree(mem);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment