Skip to content

Commit

Permalink
net: ipa: pass correct dma_handle to dma_free_coherent()
Browse files Browse the repository at this point in the history
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: 650d160 ("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>
  • Loading branch information
Dan Carpenter authored and Jakub Kicinski committed Feb 2, 2021
1 parent cc9f07a commit 4ace7a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ipa/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4ace7a6

Please sign in to comment.