WSL2-Linux-Kernel/drivers/usb/dwc3
Jack Pham 4a71fcb8ac usb: dwc3: gadget: only unmap requests from DMA if mapped
A recent optimization was made so that a request put on the
pending_list wouldn't get mapped for DMA until just before
preparing a TRB for it. However, this poses a problem in case
the request is dequeued or the endpoint is disabled before the
mapping is done as that would lead to dwc3_gadget_giveback()
unconditionally calling usb_gadget_unmap_request_for_dev() with
an invalid request->dma handle. Depending on the platform's DMA
implementation the unmap operation could result in a panic.

Since we know a successful mapping is a prerequisite for getting
a TRB, the unmap can be conditionally called only when req->trb
is non-NULL.

Fixes: cdb55b39fa ("usb: dwc3: gadget: lazily map requests for DMA")
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2017-07-17 11:01:27 +03:00
..
Kconfig
Makefile
core.c usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys 2017-07-17 10:58:56 +03:00
core.h
debug.h usb: dwc3: trace: decode ctrl request 2017-06-02 11:22:29 +03:00
debugfs.c
drd.c
dwc3-exynos.c usb: dwc3: exynos: Handle return value of clk_prepare_enable 2017-06-15 11:10:27 +03:00
dwc3-keystone.c
dwc3-of-simple.c
dwc3-omap.c usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq 2017-07-17 10:59:31 +03:00
dwc3-pci.c PM / core: Drop run_wake flag from struct dev_pm_info 2017-06-28 01:52:52 +02:00
dwc3-st.c
ep0.c usb: dwc3: ep0: make sure wValue is 0 on GetStatus() 2017-06-13 13:21:05 +03:00
gadget.c usb: dwc3: gadget: only unmap requests from DMA if mapped 2017-07-17 11:01:27 +03:00
gadget.h
host.c
io.h
trace.c
trace.h usb: dwc3: trace: decode ctrl request 2017-06-02 11:22:29 +03:00
ulpi.c usb: dwc3: ulpi: conditionally resume ULPI PHY 2017-06-13 13:21:05 +03:00