summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Fourier <fourier.thomas@gmail.com>2025-12-18 12:56:45 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2026-01-16 09:02:06 +0300
commit941676c30ba5b40a01bed92448f457ce62fd1f07 (patch)
treed0c2d0a1642aba6a23d8d5c45bbc8d609952fae0
parentc904e459cf73bd379500637b4090a2939d69a85f (diff)
downloadlinux-941676c30ba5b40a01bed92448f457ce62fd1f07.tar.xz
crypto: cavium - fix dma_free_coherent() size
The size of the buffer in alloc_command_queues() is curr->size + CPT_NEXT_CHUNK_PTR_SIZE, so used that length for dma_free_coherent(). Fixes: c694b233295b ("crypto: cavium - Add the Virtual Function driver for CPT") Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/cavium/cpt/cptvf_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c
index c246920e6f54..bccd680c7f7e 100644
--- a/drivers/crypto/cavium/cpt/cptvf_main.c
+++ b/drivers/crypto/cavium/cpt/cptvf_main.c
@@ -180,7 +180,8 @@ static void free_command_queues(struct cpt_vf *cptvf,
hlist_for_each_entry_safe(chunk, node, &cqinfo->queue[i].chead,
nextchunk) {
- dma_free_coherent(&pdev->dev, chunk->size,
+ dma_free_coherent(&pdev->dev,
+ chunk->size + CPT_NEXT_CHUNK_PTR_SIZE,
chunk->head,
chunk->dma_addr);
chunk->head = NULL;