forked from MIrrors/gasket-driver
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:
committed by
Alex Van Damme
parent
0305c1f77f
commit
e1c8e7a804
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user