Skip to content
/ linux Public

Commit 53e97a3

Browse files
Thomas-fourierSasha Levin
authored andcommitted
crypto: cavium - fix dma_free_coherent() size
[ Upstream commit 941676c ] 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: c694b23 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2b757fe commit 53e97a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/crypto/cavium/cpt/cptvf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ static void free_command_queues(struct cpt_vf *cptvf,
180180

181181
hlist_for_each_entry_safe(chunk, node, &cqinfo->queue[i].chead,
182182
nextchunk) {
183-
dma_free_coherent(&pdev->dev, chunk->size,
183+
dma_free_coherent(&pdev->dev,
184+
chunk->size + CPT_NEXT_CHUNK_PTR_SIZE,
184185
chunk->head,
185186
chunk->dma_addr);
186187
chunk->head = NULL;

0 commit comments

Comments
 (0)