usb: gadget: fix request length error for isoc transfer
commita10a1b797a0fc6b352c69826c5e9cf09e2056250
authorPeter Chen <peter.chen@nxp.com>
Tue, 8 Nov 2016 02:08:24 +0000 (8 10:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:39:19 +0000 (12 11:39 +0100)
tree8f90389de4f84fdc83f43195787a59fe4d05195c
parentb429e37b80fd6738ce3d1d6450cc5b4f40ac12a4
usb: gadget: fix request length error for isoc transfer

commit 982555fc26f9d8bcdbd5f9db0378fe0682eb4188 upstream.

For isoc endpoint descriptor, the wMaxPacketSize is not real max packet
size (see Table 9-13. Standard Endpoint Descriptor, USB 2.0 specifcation),
it may contain the number of packet, so the real max packet should be
ep->desc->wMaxPacketSize && 0x7ff.

Cc: Felipe F. Tonello <eu@felipetonello.com>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Fixes: 16b114a6d797 ("usb: gadget: fix usb_ep_align_maybe
  endianness and new usb_ep_aligna")
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/usb/gadget.h