mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] USB: fix check_ctrlrecip to allow control transfers in state ADDRESS
check_ctrlrecip() disallows any control transfers if the device is deconfigured (in configuration 0, ie. state ADDRESS). This for example makes it impossible to read the device descriptors without configuring the device, although most standard device requests are allowed in this state by the spec. This patch allows control transfers for the ADDRESS state, too. Signed-off-by: Horst Schirmeier <[email protected]> Cc: Alan Stern <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
f88f8295d8
commit
24f8b116c4
1 changed files with 2 additions and 1 deletions
|
|
@ -493,7 +493,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
|
|||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ps->dev->state != USB_STATE_CONFIGURED)
|
||||
if (ps->dev->state != USB_STATE_ADDRESS
|
||||
&& ps->dev->state != USB_STATE_CONFIGURED)
|
||||
return -EHOSTUNREACH;
|
||||
if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype))
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue