Commit fcd431a9 authored by Thomas Fourier's avatar Thomas Fourier Committed by Leon Romanovsky
Browse files

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: 1ac5a404 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: default avatarThomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20251230085121.8023-2-fourier.thomas@gmail.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 43bd09d5
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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,