RDMA/cxgb4: use kmalloc() for the PBL address array

c4iw_reg_user_mr() allocates a page-sized temporary array of DMA
addresses while programming a PBL. The array has no page-specific
requirements, so allocate it with kmalloc() and release it with kfree().

This avoids the casts required by the page allocator and lets the free
operation derive the allocation size from the object.

Link: https://patch.msgid.link/20260715-get_pages-to-kmalloc-v1-1-b0b7fce288be@nvidia.com
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
This commit is contained in:
Leon Romanovsky 2026-07-16 05:03:31 -04:00 committed by Leon Romanovsky
parent ba3156e68c
commit 1318e3c33f

View File

@ -541,7 +541,7 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
if (err)
goto err_umem_release;
pages = (__be64 *) __get_free_page(GFP_KERNEL);
pages = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pages) {
err = -ENOMEM;
goto err_pbl_free;
@ -568,7 +568,7 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
mhp->wr_waitp);
pbl_done:
free_page((unsigned long) pages);
kfree(pages);
if (err)
goto err_pbl_free;