usb: gadget: rndis: don't test against req->length
authorFelipe Balbi <balbi@ti.com>
Fri, 13 May 2011 13:53:48 +0000 (16:53 +0300)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:21:06 +0000 (12:21 -0500)
commit2dee584dccfe4966a76a699834a0e7445f527bf7
tree379c5926146e596218ed16d8d8d0e5b6ad7109e7
parentdc48a6844f583d7abc38cebcee03983d7fc4c37e
usb: gadget: rndis: don't test against req->length

BugLink: http://bugs.launchpad.net/bugs/793702

commit 472b91274a6c6857877b5caddb875dcb5ecdfcb8 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/usb/gadget/f_rndis.c