mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
RDMA/usnic: use kmalloc() for the page pointer array
usnic_uiom_get_pages() uses a page-sized array of struct page pointers as temporary storage for pin_user_pages(). Nothing requires the array to come directly from the page allocator. Use kmalloc() for the array and kfree() after the pinning loop. Link: https://patch.msgid.link/20260715-get_pages-to-kmalloc-v1-3-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
ce5322367c
commit
ed3760b376
|
|
@ -114,7 +114,7 @@ static int usnic_uiom_get_pages(unsigned long addr, size_t size, int writable,
|
|||
|
||||
INIT_LIST_HEAD(chunk_list);
|
||||
|
||||
page_list = (struct page **) __get_free_page(GFP_KERNEL);
|
||||
page_list = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page_list)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ static int usnic_uiom_get_pages(unsigned long addr, size_t size, int writable,
|
|||
mmgrab(uiomr->owning_mm);
|
||||
|
||||
mmap_read_unlock(mm);
|
||||
free_page((unsigned long) page_list);
|
||||
kfree(page_list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user