summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
authorHorst Schirmeier2006-03-11 09:16:55 +0100
committerGreg Kroah-Hartman2006-03-20 23:50:02 +0100
commit24f8b116c45e46779dec553f934c3d74f79c06fb (patch)
treecc6c86511c5b98b702fa86e857a2359dacdebab2 /drivers/usb/core/devio.c
parent[PATCH] USB: vicam.c: fix a NULL pointer dereference (diff)
downloadkernel-qcow2-linux-24f8b116c45e46779dec553f934c3d74f79c06fb.tar.gz
kernel-qcow2-linux-24f8b116c45e46779dec553f934c3d74f79c06fb.tar.xz
kernel-qcow2-linux-24f8b116c45e46779dec553f934c3d74f79c06fb.zip
[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 <horst@schirmeier.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index de6a7c07cf97..545da37afca7 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -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;