public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]   infiniband/hw/hfi1/tid_rdma: use kmalloc_array_node()
@ 2024-07-25  7:17 flyingpenghao
  2024-07-25 11:58 ` Zhu Yanjun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: flyingpenghao @ 2024-07-25  7:17 UTC (permalink / raw)
  To: dennis.dalessandro, leon; +Cc: linux-rdma, Peng Hao

From: Peng Hao <flyingpeng@tencent.com>

kmalloc_array_node() is a NUMA-aware version of kmalloc_array that
has overflow checking and can be used as a replacement for kmalloc_node.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
---
 drivers/infiniband/hw/hfi1/tid_rdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c
index c465966a1d9c..6b1921f6280b 100644
--- a/drivers/infiniband/hw/hfi1/tid_rdma.c
+++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
@@ -1636,7 +1636,7 @@ static int hfi1_kern_exp_rcv_alloc_flows(struct tid_rdma_request *req,
 
 	if (likely(req->flows))
 		return 0;
-	flows = kmalloc_node(MAX_FLOWS * sizeof(*flows), gfp,
+	flows = kmalloc_array_node(MAX_FLOWS, sizeof(*flows), gfp,
 			     req->rcd->numa_id);
 	if (!flows)
 		return -ENOMEM;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-28  7:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25  7:17 [PATCH] infiniband/hw/hfi1/tid_rdma: use kmalloc_array_node() flyingpenghao
2024-07-25 11:58 ` Zhu Yanjun
2024-07-25 13:46 ` Dean Luick
2024-07-28  7:52   ` Leon Romanovsky
2024-07-28  7:53 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox