diff options
author | Kees Cook <keescook@chromium.org> | 2018-07-04 10:31:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-06 17:35:42 +0200 |
commit | 9f2378d94d0f026389fff351848f2adc484650fe (patch) | |
tree | 1d0c76be0715961c6aa054a41a6f491b8eb7faea /drivers/staging/gasket/gasket_page_table.c | |
parent | 7383f87de80694f1f4c21b81b964d42a54144cfb (diff) |
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>
Diffstat (limited to 'drivers/staging/gasket/gasket_page_table.c')
-rw-r--r-- | drivers/staging/gasket/gasket_page_table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index 6dc10508b15e..c5390a860f86 100644 --- a/drivers/staging/gasket/gasket_page_table.c +++ b/drivers/staging/gasket/gasket_page_table.c @@ -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; |