mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
binfmt_misc: replace __get_free_page() with kmalloc()
bm_entry_read() allocates temporary buffer using __get_free_page(). kmalloc() is a better API for such use and it also provides better scalability and more debugging possibilities. Replace use of __get_free_page() with kmalloc(). Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://patch.msgid.link/20260523-b4-fs-v1-16-275e36a83f0e@kernel.org Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
parent
1b27d11b17
commit
6ff17653e9
|
|
@ -704,7 +704,7 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
|||
ssize_t res;
|
||||
char *page;
|
||||
|
||||
page = (char *) __get_free_page(GFP_KERNEL);
|
||||
page = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ bm_entry_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
|
|||
|
||||
res = simple_read_from_buffer(buf, nbytes, ppos, page, strlen(page));
|
||||
|
||||
free_page((unsigned long) page);
|
||||
kfree(page);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user