]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: fix dma_free_coherent() pointer
authorThomas Fourier <fourier.thomas@gmail.com>
Tue, 30 Dec 2025 08:51:21 +0000 (09:51 +0100)
committerLeon Romanovsky <leon@kernel.org>
Tue, 30 Dec 2025 11:45:51 +0000 (06:45 -0500)
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>
drivers/infiniband/hw/bnxt_re/qplib_res.c

index d5c12a51aa4387f040539f309fe630a55d7bb71b..4d674a3aee1aa33ee85a011ab3d0d7879edae069 100644 (file)
@@ -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,