Re: [PATCH] USB: core: replace kmalloc + copy_from_user with memdup_user

From: Greg Kroah-Hartman
Date: Wed Oct 08 2025 - 07:06:00 EST


On Fri, Sep 19, 2025 at 01:56:50PM +0200, Thorsten Blum wrote:
> Replace kmalloc() followed by copy_from_user() with memdup_user() to
> simplify and improve proc_do_submiturb(). Replace the hard-coded 8 bytes
> with the size of 'struct usb_ctrlrequest'.
>
> Return early if an error occurs, and avoid manually setting 'ret' and
> using 'goto error'.
>
> No functional changes intended.


Same comments as the other patch that you submitted doing the same thing
for a different part of the same function.

thanks,

greg k-h