summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2/gadget.c
diff options
context:
space:
mode:
authorRazmik Karapetyan <razmik@synopsys.com>2016-11-17 02:33:55 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 14:54:52 +0300
commit729e65746d4f225792e33371f3ae6d614ec66032 (patch)
treeb08c5ae0069c3bd49902771fdf68657c27c489ed /drivers/usb/dwc2/gadget.c
parent9d8da85798cb45c803e449284c4564d572756428 (diff)
downloadlinux-729e65746d4f225792e33371f3ae6d614ec66032.tar.xz
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/gadget.c')
-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().