]> git.baikalelectronics.ru Git - kernel.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)
commitb399b2265fc5b69fcd9c24853f47aaec26345073
tree4d4008c97a46d364676d3c6d43b7a15031730526
parentc854880a4adc59463f8a6d97b1061a4784f3e62f
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