diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2019-10-02 15:19:14 +0300 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2019-10-31 14:12:31 +0300 |
commit | fd15b58c1a9a61edcdeef8ce1eb4df2442295f58 (patch) | |
tree | 5f229061e8f989914271ce5e4c477033b9b1e773 /drivers/usb | |
parent | d2d8eab42118f8c25e8562495438c903893b83fd (diff) | |
download | u-boot-fd15b58c1a9a61edcdeef8ce1eb4df2442295f58.tar.xz |
dwc3: flush cache only if there is a buffer attached to a request
Calling cache flush on invalid buffer, even with zero length might cause
an exception on certain platforms.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 085f7b8968..67d11b4c0d 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -242,7 +242,8 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, list_del(&req->list); req->trb = NULL; - dwc3_flush_cache((uintptr_t)req->request.dma, req->request.length); + if (req->request.length) + dwc3_flush_cache((uintptr_t)req->request.dma, req->request.length); if (req->request.status == -EINPROGRESS) req->request.status = status; |