diff options
author | Marek Szyprowski | 2019-10-02 14:19:14 +0200 |
---|---|---|
committer | Marek Vasut | 2019-10-31 12:12:31 +0100 |
commit | fd15b58c1a9a61edcdeef8ce1eb4df2442295f58 (patch) | |
tree | 5f229061e8f989914271ce5e4c477033b9b1e773 /drivers/usb/dwc3 | |
parent | d2d8eab42118f8c25e8562495438c903893b83fd (diff) |
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/dwc3')
-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 085f7b89688..67d11b4c0d7 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; |