Commit 67aeca37 authored by Felipe Balbi's avatar Felipe Balbi Committed by Kleber Sacilotto de Souza

usb: gadget: udc: core: don't starve DMA resources

BugLink: https://bugs.launchpad.net/bugs/1878232

commit 23fd537c upstream.

Always unmap all SG entries as required by DMA API

Fixes: a698908d ("usb: gadget: add generic map/unmap request utilities")
Cc: <stable@vger.kernel.org> # v3.4+
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 991145e0
......@@ -97,7 +97,7 @@ void usb_gadget_unmap_request(struct usb_gadget *gadget,
return;
if (req->num_mapped_sgs) {
dma_unmap_sg(gadget->dev.parent, req->sg, req->num_mapped_sgs,
dma_unmap_sg(gadget->dev.parent, req->sg, req->num_sgs,
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
req->num_mapped_sgs = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment