RDMA/bnxt_re: fix dma_free_coherent() pointer
Subsystems (3)
PATCH 1/1 RDMA/bnxt_re: fix dma_free_coherent() pointer
The dma_alloc_coherent() allocates a dma-mapped buffer, pbl->pg_arr[i]. The dma_free_coherent() should pass the same buffer to dma_free_coherent() and not page-aligned.
Fixes 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Cc <[email protected]>
Signed-off-by Thomas Fourier <[email protected]>
--- drivers/infiniband/hw/bnxt_re/qplib_res.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_res.c +1 -3
@@ -64,9 +64,7 @@ static void __free_pbl(struct bnxt_qplib_res *res, struct bnxt_qplib_pbl *pbl,for (i =0 ; i < pbl->pg_count; i++) {if (pbl->pg_arr[i])dma_free_coherent (&pdev->dev, pbl->pg_size, - (void *)((unsigned long ) - pbl->pg_arr[i] & -PAGE_MASK ), + pbl->pg_arr[i], pbl->pg_map_arr[i]);else dev_warn(&pdev->dev,
Signature · 1 line
2.43.0
Leon Romanovsky
AppliedQuoted 5 lines · Thomas Fourier
The
dma_alloc_coherent()allocates a dma-mapped buffer, pbl->pg_arr[i]. Thedma_free_coherent()should pass the same buffer todma_free_coherent()and not page-aligned.
Applied, thanks!
[1/1] RDMA/bnxt_re: fix dma_free_coherent() pointer
https://git.kernel.org/rdma/rdma/c/fcd431a9627f27
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>