]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
usb: misc: ehset: update to use the usb_control_msg_{send|recv}() API
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>
Fri, 26 Mar 2021 22:32:49 +0000 (04:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Mar 2021 11:41:27 +0000 (13:41 +0200)
commitf5ffdd3b7554158ec5be6ab28a48751d1d87d0cc
tree4d4008c97a46d364676d3c6d43b7a15031730526
parentc21161e40ee94486f7db701f9b4d3f9c25763e8c
usb: misc: ehset: update to use the usb_control_msg_{send|recv}() API

The newer usb_control_msg_{send|recv}() API ensures that a short read
is treated as an error, data can be used off the stack, and raw usb
pipes need not be created in the calling functions.
For this reason, instances of usb_control_msg() have been replaced with
usb_control_msg_{recv|send}() appropriately.

Now, we also test for a short device descriptor (which USB core
should already have fetched if you get to probe this driver), but which
wasn't verified again here before.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Link: https://lore.kernel.org/r/20210326223251.753952-2-anant.thazhemadam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/ehset.c