UPSTREAM: USB: core: Change usb_get_device_descriptor() API
commit de28e469 upstream. The usb_get_device_descriptor() routine reads the device descriptor from the udev device and stores it directly in udev->descriptor. This interface is error prone, because the USB subsystem expects in-memory copies of a device's descriptors to be immutable once the device has been initialized. The interface is changed so that the device descriptor is left in a kmalloc-ed buffer, not copied into the usb_device structure. A pointer to the buffer is returned to the caller, who is then responsible for kfree-ing it. The corresponding changes needed in the various callers are fairly small. Bug: 290990909 Signed-off-by:Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/d0111bb6-56c1-4f90-adf2-6cfe152f6561@rowland.harvard.edu Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit eda9a296) Signed-off-by:
Lee Jones <joneslee@google.com> Change-Id: I7c4be5b5dd06f7d5ba8aacad33ecf78f4a3b49e6
Loading
Please sign in to comment