Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20251230085121.8023-2-fourier.thomas@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Thomas Fourier and committed by
Leon Romanovsky
fcd431a9 43bd09d5

+1 -3
+1 -3
drivers/infiniband/hw/bnxt_re/qplib_res.c
··· 64 64 for (i = 0; i < pbl->pg_count; i++) { 65 65 if (pbl->pg_arr[i]) 66 66 dma_free_coherent(&pdev->dev, pbl->pg_size, 67 - (void *)((unsigned long) 68 - pbl->pg_arr[i] & 69 - PAGE_MASK), 67 + pbl->pg_arr[i], 70 68 pbl->pg_map_arr[i]); 71 69 else 72 70 dev_warn(&pdev->dev,