From: Razmik Karapetyan Date: Wed, 16 Nov 2016 23:33:55 +0000 (-0800) Subject: usb: dwc2: Don't program DMA address for 0 length request X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=729e65746d4f225792e33371f3ae6d614ec66032;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- 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().