diff options
author | Felipe Balbi <balbi@ti.com> | 2011-05-13 09:53:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-13 18:51:09 -0400 |
commit | 472b91274a6c6857877b5caddb875dcb5ecdfcb8 (patch) | |
tree | 66d78459ecd7c7a42e739501bba2b8f5918b180c /drivers/usb | |
parent | bf1f0a05d472e33dda8e5e69525be1584cdbd03a (diff) |
usb: gadget: rndis: don't test against req->length
composite.c always sets req->length to zero
and expects function driver's setup handlers
to return the amount of bytes to be used
on req->length. If we test against req->length
w_length will always be greater than req->length
thus making us always stall that particular
SEND_ENCAPSULATED_COMMAND request.
Tested against a Windows XP SP3.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/f_rndis.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 882484a40398..fa12ec8364ef 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -420,8 +420,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) | |||
420 | */ | 420 | */ |
421 | case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | 421 | case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) |
422 | | USB_CDC_SEND_ENCAPSULATED_COMMAND: | 422 | | USB_CDC_SEND_ENCAPSULATED_COMMAND: |
423 | if (w_length > req->length || w_value | 423 | if (w_value || w_index != rndis->ctrl_id) |
424 | || w_index != rndis->ctrl_id) | ||
425 | goto invalid; | 424 | goto invalid; |
426 | /* read the request; process it later */ | 425 | /* read the request; process it later */ |
427 | value = w_length; | 426 | value = w_length; |