Re: [PATCH for-next 03/12] IB/hfi1: Remove the debug trace message in pin_sdma_pages()

Dennis Dalessandro
2017-09-29T14:01:59Z

On 9/27/2017 11:30 AM, Leon Romanovsky wrote:
>
> BTW, by looking on something else,
>
> 1. I saw that you are not checking for kcalloc failure in drivers/infiniband/hw/hfi1/verbs.c
>
> 1138 empty_buf = kcalloc(extra_bytes, sizeof(u8),
> 1139 GFP_KERNEL);
> 1140 seg_pio_copy_mid(pbuf, empty_buf, extra_bytes);
>
> 2. The following code in drivers/infiniband/hw/hfi1/sdma.c, can and
> should be replaced by kvmalloc. You are incorrectly open-coded failback.
>
> 1467 sde->tx_ring =
> 1468 kcalloc(descq_cnt, sizeof(struct sdma_txreq *),
> 1469 GFP_KERNEL);
> 1470 if (!sde->tx_ring)
> 1471 sde->tx_ring =
> 1472 vzalloc(
> 1473 sizeof(struct sdma_txreq *) *
> 1474 descq_cnt);
>

Thanks, we will look into fixing these two issues.

-Denny