]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: gadget: udc: core: don't starve DMA resources
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 24 Aug 2016 11:33:27 +0000 (14:33 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 25 Aug 2016 07:36:24 +0000 (10:36 +0300)
Always unmap all SG entries as required by DMA API

Fixes: a698908d3b3b ("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>
drivers/usb/gadget/udc/core.c

index 934f83881c3074250d9117df691463cddb61ca0c..40c04bb25f2f9f2eee7c4b326e8585e6de3e4fb9 100644 (file)
@@ -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;