diff options
author | Cristina Moraru <cristina.moraru09@gmail.com> | 2015-10-21 20:00:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-24 19:00:15 -0700 |
commit | fb1dc957054c6a9823b20b2672f5193e47bc5f6d (patch) | |
tree | dcbfd82afa781876e92136f13be20dc1dd03c7d2 /drivers/staging/rdma/ipath | |
parent | staging: lustre: lnet :socklnd Braces not necessary (diff) | |
download | linux-dev-fb1dc957054c6a9823b20b2672f5193e47bc5f6d.tar.xz linux-dev-fb1dc957054c6a9823b20b2672f5193e47bc5f6d.zip |
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/ipath')
-rw-r--r-- | drivers/staging/rdma/ipath/ipath_verbs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rdma/ipath/ipath_verbs.c b/drivers/staging/rdma/ipath/ipath_verbs.c index 40f7f059f6b2..ea3f21aa0b38 100644 --- a/drivers/staging/rdma/ipath/ipath_verbs.c +++ b/drivers/staging/rdma/ipath/ipath_verbs.c @@ -2025,8 +2025,8 @@ int ipath_register_ib_device(struct ipath_devdata *dd) dev = &idev->ibdev; if (dd->ipath_sdma_descq_cnt) { - tx = kmalloc(dd->ipath_sdma_descq_cnt * sizeof *tx, - GFP_KERNEL); + tx = kmalloc_array(dd->ipath_sdma_descq_cnt, sizeof *tx, + GFP_KERNEL); if (tx == NULL) { ret = -ENOMEM; goto err_tx; |