summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorRazmik Karapetyan <razmik@synopsys.com>2016-11-16 15:33:55 -0800
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 13:54:52 +0200
commit729e65746d4f225792e33371f3ae6d614ec66032 (patch)
treeb08c5ae0069c3bd49902771fdf68657c27c489ed /drivers/usb/dwc2
parent9d8da85798cb45c803e449284c4564d572756428 (diff)
usb: dwc2: Don't program DMA address for 0 length request
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 <razmik@synopsys.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index ad0cd0e38f06..4dd5f1e2d281 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().