drivers/staging/gasket: Use 2-factor allocator calls

As already done treewide, switch from open-coded multiplication to using
2-factor allocator helpers.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Kees Cook
2018-07-04 10:31:25 -07:00
committed by Alex Van Damme
parent 0305c1f77f
commit e1c8e7a804
4 changed files with 21 additions and 18 deletions

View File

@@ -1674,9 +1674,9 @@ int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size,
gasket_dev->page_table[index]->num_coherent_pages = num_pages;
/* allocate the physical memory block */
gasket_dev->page_table[index]->coherent_pages = kzalloc(
num_pages * sizeof(struct gasket_coherent_page_entry),
GFP_KERNEL);
gasket_dev->page_table[index]->coherent_pages =
kcalloc(num_pages, sizeof(struct gasket_coherent_page_entry),
GFP_KERNEL);
if (!gasket_dev->page_table[index]->coherent_pages)
goto nomem;
*dma_address = 0;