From: Mike Marciniszyn Date: Mon, 23 Oct 2017 13:06:32 +0000 (-0700) Subject: IB/hfi1: Take advantage of kvzalloc_node in sdma initialization X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=31acd18b61a48bf9225f106a6ff74774583ee375;p=openwrt%2Fstaging%2Fblogic.git IB/hfi1: Take advantage of kvzalloc_node in sdma initialization The code that allocates the tx ring in the sdma code fails to take advantage of kvzalloc variations. Fix by converting to use kvzalloc_node. Reported-by: Leon Romanovsky Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Reviewed-by: Leon Romanovsky Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index 78716b829a28..6a1b8e479616 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c @@ -1465,13 +1465,8 @@ int sdma_init(struct hfi1_devdata *dd, u8 port) if (!sde->descq) goto bail; sde->tx_ring = - kcalloc(descq_cnt, sizeof(struct sdma_txreq *), - GFP_KERNEL); - if (!sde->tx_ring) - sde->tx_ring = - vzalloc( - sizeof(struct sdma_txreq *) * - descq_cnt); + kvzalloc_node(sizeof(struct sdma_txreq *) * descq_cnt, + GFP_KERNEL, dd->node); if (!sde->tx_ring) goto bail; }