]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usb: dwc3: gadget: Handle 0 xfer length for OUT EP
authorTejas Joglekar <tejas.joglekar@synopsys.com>
Tue, 22 Jan 2019 07:56:51 +0000 (13:26 +0530)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commite49741795516f18297d200b00a64c91bc3213f79
treea9805850f9447129b24fb12e849e8ca8bc03bb09
parentbcc6bd33910703735140ae82e3504511e700ad47
usb: dwc3: gadget: Handle 0 xfer length for OUT EP

BugLink: https://bugs.launchpad.net/bugs/1837664
commit 1e19cdc8060227b0802bda6bc0bd22b23679ba32 upstream.

For OUT endpoints, zero-length transfers require MaxPacketSize buffer as
per the DWC_usb3 programming guide 3.30a section 4.2.3.3.

This patch fixes this by explicitly checking zero length
transfer to correctly pad up to MaxPacketSize.

Fixes: c6267a51639b ("usb: dwc3: gadget: align transfers to wMaxPacketSize")
Cc: stable@vger.kernel.org
Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/usb/dwc3/gadget.c