mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
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:
parent
ba3156e68c
commit
1318e3c33f
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user