usb: gadget: rndis: don't test against req->length
commitd4ffbbb11ad59a922ea546eda88316a3511890fe
authorFelipe Balbi <balbi@ti.com>
Fri, 13 May 2011 13:53:48 +0000 (13 16:53 +0300)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:52 +0000 (1 13:54 -0700)
tree09710680b9640eef3f71fd3fba65b0e73fcb5b0b
parent207e1f6a999784bc8e7047f4ae9f72c73d48a9b2
usb: gadget: rndis: don't test against req->length

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: Andi Kleen <ak@linux.intel.com>
drivers/usb/gadget/f_rndis.c