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)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 28 Jan 2019 13:27:07 +0000 (15:27 +0200)
commit1e19cdc8060227b0802bda6bc0bd22b23679ba32
treed8f38b00ff465d8a098f147a7950ddcec1251749
parentf17b5f06cb92ef2250513a1e154c47b78df07d40
usb: dwc3: gadget: Handle 0 xfer length for OUT EP

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>
drivers/usb/dwc3/gadget.c