usb: dwc3: Ensure req->dma is initialized to DMA_ERROR_CODE
commit 269a1b78 "usb: gadget: Add support for DMA mapping optimization of request buffers" added checks to usb_gadget_{map,unmap}_request() to support the pre-mapped DMA buffers that a function can map ahead of time before enqueing the request. However, these routines check the req->dma for a sentinel value, DMA_ERROR_CODE, in order to determine whether or not to proceed with dma_map/unmap(). This means that UDC drivers should initialize to this value when allocating each new request. Do this in the dwc3 gadget driver in order to properly support this. This fixes an issue in which usb_gadget_unmap_request() was incorrectly being called on an uninitialized (as 0) req->dma address, and proceeds to call dma_unmap() which interprets it as physical address 0x0. Change-Id: I514d2b824e272c6c42c483febaa1c4084b0d09ee Signed-off-by:Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment