diff options
author | Cristina Moraru <cristina.moraru09@gmail.com> | 2015-10-21 17:00:51 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-25 02:00:15 (GMT) |
commit | fb1dc957054c6a9823b20b2672f5193e47bc5f6d (patch) | |
tree | dcbfd82afa781876e92136f13be20dc1dd03c7d2 /drivers/staging/rdma/amso1100 | |
parent | df5ddcc97e694bfa5dafa838c26e5b974c706929 (diff) | |
download | linux-fb1dc957054c6a9823b20b2672f5193e47bc5f6d.tar.xz |
staging: rdma: Replace kmalloc with kmalloc_array
Replace kmalloc with specialized function kmalloc_array
when the size is a multiplication of:
number_of_elements * size_of_element
Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma/amso1100')
-rw-r--r-- | drivers/staging/rdma/amso1100/c2_provider.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rdma/amso1100/c2_provider.c b/drivers/staging/rdma/amso1100/c2_provider.c index 2563215..c707e45 100644 --- a/drivers/staging/rdma/amso1100/c2_provider.c +++ b/drivers/staging/rdma/amso1100/c2_provider.c @@ -462,7 +462,7 @@ static struct ib_mr *c2_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, shift = ffs(c2mr->umem->page_size) - 1; n = c2mr->umem->nmap; - pages = kmalloc(n * sizeof(u64), GFP_KERNEL); + pages = kmalloc_array(n, sizeof(u64), GFP_KERNEL); if (!pages) { err = -ENOMEM; goto err; |