Ignore:
Timestamp:
Apr 14, 2017, 9:41:36 PM (6 weeks ago)
Author:
brainslayer
Message:

kernel update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/usb/dwc3/gadget.c

    r31632 r31859  
    188188{
    189189        struct dwc3                     *dwc = dep->dwc;
     190        unsigned int                    unmap_after_complete = false;
    190191
    191192        req->started = false;
     
    196197                req->request.status = status;
    197198
    198         if (dwc->ep0_bounced && dep->number <= 1)
     199        /*
     200         * NOTICE we don't want to unmap before calling ->complete() if we're
     201         * dealing with a bounced ep0 request. If we unmap it here, we would end
     202         * up overwritting the contents of req->buf and this could confuse the
     203         * gadget driver.
     204         */
     205        if (dwc->ep0_bounced && dep->number <= 1) {
    199206                dwc->ep0_bounced = false;
    200 
    201         usb_gadget_unmap_request(&dwc->gadget, &req->request,
    202                         req->direction);
     207                unmap_after_complete = true;
     208        } else {
     209                usb_gadget_unmap_request(&dwc->gadget,
     210                                &req->request, req->direction);
     211        }
    203212
    204213        trace_dwc3_gadget_giveback(req);
     
    207216        usb_gadget_giveback_request(&dep->endpoint, &req->request);
    208217        spin_lock(&dwc->lock);
     218
     219        if (unmap_after_complete)
     220                usb_gadget_unmap_request(&dwc->gadget,
     221                                &req->request, req->direction);
    209222
    210223        if (dep->number > 1)
Note: See TracChangeset for help on using the changeset viewer.