Skip to contentSkip to conversation

drivers/infiniband/sw/rdmavt/qp.c: use kmalloc_array_node()

PATCH New [email protected] 1 participant 1 message Nov 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 24/131 drivers/infiniband/sw/rdmavt/qp.c: use kmalloc_array_node()

From: Johannes Thumshirn <[email protected]>
Subject: drivers/infiniband/sw/rdmavt/qp.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.

Cc Christoph Hellwig <[email protected]>
Cc Damien Le Moal <[email protected]>
Cc David Rientjes <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Doug Ledford <[email protected]>
Cc Hal Rosenstock <[email protected]>
Cc Jens Axboe <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Mike Marciniszyn <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Sean Hefty <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 drivers/infiniband/sw/rdmavt/qp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rdmavt/qp.c renamed from drivers/infiniband/sw/rdmavt/qp.c~ib-rdmavt-use-kmalloc_array_node +1 -1
diff -puN drivers/infiniband/sw/rdmavt/qp.c~ib-rdmavt-use-kmalloc_array_node drivers/infiniband/sw/rdmavt/qp.c
@@ -238,7 +238,7 @@ int rvt_driver_qp_init(struct rvt_dev_in
 	rdi->qp_dev->qp_table_size = rdi->dparms.qp_table_size;
 	rdi->qp_dev->qp_table_bits = ilog2(rdi->dparms.qp_table_size);
 	rdi->qp_dev->qp_table =
-		kmalloc_node(rdi->qp_dev->qp_table_size *
+		kmalloc_array_node(rdi->qp_dev->qp_table_size,
 			     sizeof(*rdi->qp_dev->qp_table),
 			     GFP_KERNEL, rdi->dparms.node);
 	if (!rdi->qp_dev->qp_table)

_