]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: cavium - fix dma_free_coherent() size
authorThomas Fourier <fourier.thomas@gmail.com>
Thu, 18 Dec 2025 09:56:45 +0000 (10:56 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 16 Jan 2026 06:02:06 +0000 (14:02 +0800)
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>
drivers/crypto/cavium/cpt/cptvf_main.c

index c246920e6f540c981097964ff687171b041d4fb8..bccd680c7f7ee46b7eddbb75d873388fb13f27b2 100644 (file)
@@ -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;