From: Razmik Karapetyan <raz...@synopsys.com>

Check the request length in dwc2_hsotg_start_req() function. If
length == 0, do not write DMA address to control register.

Signed-off-by: Razmik Karapetyan <raz...@synopsys.com>
Signed-off-by: John Youn <johny...@synopsys.com>
---
 drivers/usb/dwc2/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index ad0cd0e..4dd5f1e 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -1018,7 +1018,7 @@ static void dwc2_hsotg_start_req(struct dwc2_hsotg *hsotg,
                /* write size / packets */
                dwc2_writel(epsize, hsotg->regs + epsize_reg);
 
-               if (using_dma(hsotg) && !continuing) {
+               if (using_dma(hsotg) && !continuing && (length != 0)) {
                        /*
                         * write DMA address to control register, buffer
                         * already synced by dwc2_hsotg_ep_queue().
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to