Skip to content

Commit

Permalink
usb: gadget: udc: core: don't starve DMA resources
Browse files Browse the repository at this point in the history
Always unmap all SG entries as required by DMA API

Fixes: a698908 ("usb: gadget: add generic map/unmap request utilities")
Cc: <stable@vger.kernel.org> # v3.4+
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Felipe Balbi committed Aug 25, 2016
1 parent 511a36d commit 23fd537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ void usb_gadget_unmap_request_by_dev(struct device *dev,
return;

if (req->num_mapped_sgs) {
dma_unmap_sg(dev, req->sg, req->num_mapped_sgs,
dma_unmap_sg(dev, req->sg, req->num_sgs,
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);

req->num_mapped_sgs = 0;
Expand Down

0 comments on commit 23fd537

Please sign in to comment.