Re: [PATCH 1/4] USB: usbfs: replace __get_free_page() with kmalloc()

From
Mike Rapoport <rppt@kernel.org>
Date
2026-08-31 14:25:01
Also in
linux-mm, linux-usb, lkml
Reply to
Oliver Neukum, 2026-08-31
On Mon, Aug 31, 2026 at 03:27:07PM +0200, Oliver Neukum wrote:
On 30.08.26 10:10, Mike Rapoport (Microsoft) wrote:
quoted
do_proc_control() allocates a temporary buffer for the data stage of a
control transfer issued from userspace.

This buffer can be allocated with kmalloc() as there's nothing special
about it to go directly to the page allocator.
You are breaking the calculation. A page has a size of exactly
PAGE_SIZE. A kmalloced object of PAGE_SIZE is larger. That is
a bad idea.
What calculation does it break and why do you say that kmalloc(PAGE_SIZE)
gives you an object larger than PAGE_SIZE?
 
	Regards
		Oliver
-- 
Sincerely yours,
Mike.
Thread (14 messages) 14 messages, 7 authors, last reply 2026-09-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help