aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <[email protected]>2017-11-15 17:32:37 -0800
committerLinus Torvalds <[email protected]>2017-11-15 18:21:02 -0800
commit7d50207163414d38e6a706904bd915db145fb8a0 (patch)
tree59393202aa73facb463d174800f175b137d4c7c1
parentd904bfa79f9ca683d4e51c8d38f79f8be0f70f2a (diff)
drivers/infiniband/hw/qib/qib_init.c: use kmalloc_array_node()
Now that we have a NUMA-aware version of kmalloc_array() we can use it instead of kmalloc_node() without an overflow check in the size calculation. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Cc: Mike Marciniszyn <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Sean Hefty <[email protected]> Cc: Hal Rosenstock <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Damien Le Moal <[email protected]> Cc: David Rientjes <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--drivers/infiniband/hw/qib/qib_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c
index c5a4c65636d6..6aebf4e707b9 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -1674,8 +1674,9 @@ int qib_setup_eagerbufs(struct qib_ctxtdata *rcd)
}
if (!rcd->rcvegrbuf_phys) {
rcd->rcvegrbuf_phys =
- kmalloc_node(chunk * sizeof(rcd->rcvegrbuf_phys[0]),
- GFP_KERNEL, rcd->node_id);
+ kmalloc_array_node(chunk,
+ sizeof(rcd->rcvegrbuf_phys[0]),
+ GFP_KERNEL, rcd->node_id);
if (!rcd->rcvegrbuf_phys)
goto bail_rcvegrbuf;
}