]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: ipa: pass correct dma_handle to dma_free_coherent()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 2 Feb 2021 05:55:25 +0000 (08:55 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Feb 2021 16:46:22 +0000 (08:46 -0800)
The "ring->addr = addr;" assignment is done a few lines later so we
can't use "ring->addr" yet.  The correct dma_handle is "addr".

Fixes: 650d1603825d ("soc: qcom: ipa: the generic software interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/YBjpTU2oejkNIULT@mwanda
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/gsi.c

index 14d9a791924bf9b6b16f53cba222ec6ff20cf2bf..b8f39e48a0093c1e40541072aa6d64e2fc265c16 100644 (file)
@@ -1373,7 +1373,7 @@ static int gsi_ring_alloc(struct gsi *gsi, struct gsi_ring *ring, u32 count)
        /* Hardware requires a 2^n ring size, with alignment equal to size */
        ring->virt = dma_alloc_coherent(dev, size, &addr, GFP_KERNEL);
        if (ring->virt && addr % size) {
-               dma_free_coherent(dev, size, ring->virt, ring->addr);
+               dma_free_coherent(dev, size, ring->virt, addr);
                dev_err(dev, "unable to alloc 0x%zx-aligned ring buffer\n",
                        size);
                return -EINVAL; /* Not a good error value, but distinct */