Skip to content

Commit

Permalink
crypto: ixp4xx - dma_unmap the correct address
Browse files Browse the repository at this point in the history
[ Upstream commit 9395c58 ]

Testing ixp4xx_crypto with CONFIG_DMA_API_DEBUG lead to the following error:
DMA-API: platform ixp4xx_crypto.0: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=24 bytes]

This is due to dma_unmap using the wrong address.

Fixes: 0d44dc5 ("crypto: ixp4xx - Fix handling of chained sg buffers")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
montjoie authored and gregkh committed Jul 14, 2021
1 parent 16e78cc commit bd2a2b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/ixp4xx_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static void free_buf_chain(struct device *dev, struct buffer_desc *buf,

buf1 = buf->next;
phys1 = buf->phys_next;
dma_unmap_single(dev, buf->phys_next, buf->buf_len, buf->dir);
dma_unmap_single(dev, buf->phys_addr, buf->buf_len, buf->dir);
dma_pool_free(buffer_pool, buf, phys);
buf = buf1;
phys = phys1;
Expand Down

0 comments on commit bd2a2b2

Please sign in to comment.