summaryrefslogtreecommitdiff
path: root/drivers/staging/rdma/ipath
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-11-08 14:17:52 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-11-20 00:55:37 (GMT)
commit8b3e676b0cb9444f8de18b54dee1ccb51f152460 (patch)
tree79ffb17fa090c5b670ba8785f53ad7a0712805d6 /drivers/staging/rdma/ipath
parentb629a6f63d5d7a8aab1b57223e4353427824c6d7 (diff)
downloadlinux-8b3e676b0cb9444f8de18b54dee1ccb51f152460.tar.xz
staging: rdma: use kmalloc_array instead of kmalloc
Use kmalloc_array instead of kmalloc to allocate memory for an array. Signed-off-by: Geliang Tang <geliangtang@163.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_file_ops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rdma/ipath/ipath_file_ops.c b/drivers/staging/rdma/ipath/ipath_file_ops.c
index 13c3cd1..6187b84 100644
--- a/drivers/staging/rdma/ipath/ipath_file_ops.c
+++ b/drivers/staging/rdma/ipath/ipath_file_ops.c
@@ -917,15 +917,15 @@ static int ipath_create_user_egr(struct ipath_portdata *pd)
chunk = pd->port_rcvegrbuf_chunks;
egrperchunk = pd->port_rcvegrbufs_perchunk;
size = pd->port_rcvegrbuf_size;
- pd->port_rcvegrbuf = kmalloc(chunk * sizeof(pd->port_rcvegrbuf[0]),
- GFP_KERNEL);
+ pd->port_rcvegrbuf = kmalloc_array(chunk, sizeof(pd->port_rcvegrbuf[0]),
+ GFP_KERNEL);
if (!pd->port_rcvegrbuf) {
ret = -ENOMEM;
goto bail;
}
pd->port_rcvegrbuf_phys =
- kmalloc(chunk * sizeof(pd->port_rcvegrbuf_phys[0]),
- GFP_KERNEL);
+ kmalloc_array(chunk, sizeof(pd->port_rcvegrbuf_phys[0]),
+ GFP_KERNEL);
if (!pd->port_rcvegrbuf_phys) {
ret = -ENOMEM;
goto bail_rcvegrbuf;