]> 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)
commit9835738e16df6f943268f7742d5bf3978c4268c0
tree4d4008c97a46d364676d3c6d43b7a15031730526
parent0d18933681fb54d9893d9a5eb4c88738f9136f26
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