Searched hist:"90 a5cd4a26142ef7afd3d5f92cae5a749c9f0938" (Results 1 – 1 of 1) sorted by relevance
| /rk3399_rockchip-uboot/drivers/usb/dwc3/ |
| H A D | gadget.c | 90a5cd4a26142ef7afd3d5f92cae5a749c9f0938 Tue May 28 08:35:03 UTC 2024 Neil Armstrong <neil.armstrong@linaro.org> UPSTREAM: usb: dwc3: gadget: fix crash in dwc3_gadget_giveback()
If the ep0 stalls or request are dequeued when gagdet is stopped, the request dma may not be mapped yet and dwc3_flush_cache() may be called with a NULL pointer.
Check req->request.dma before calling dwc3_flush_cache() and later the usb_gadget_unmap_request() functions since it means that usb_gadget_map_request() hasn't been called yet.
Fixes: fd15b58c1a9 ("dwc3: flush cache only if there is a buffer attached to a request") Change-Id: I08df172aaea16bd09f3c9596576d3b45f7338caa Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240528-topic-sm8x50-dwc3-gadget-crash-fix-v1-1-58434ab4b3d3@linaro.org Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: William Wu <william.wu@rock-chips.com> (cherry picked from commit 85ced6f4745f529098cae38a5bd3144035a1318c)
|