Skip to content

Commit 1ee57ab

Browse files
Thomas-fourierherbertx
authored andcommitted
crypto: hisilicon - Fix dma_unmap_single() direction
The direction used to map the buffer skreq->iv is DMA_TO_DEVICE but it is unmapped with direction DMA_BIDIRECTIONAL in the error path. Change the unmap to match the mapping. Fixes: 915e4e8 ("crypto: hisilicon - SEC security accelerator driver") Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Reviewed-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a1b8001 commit 1ee57ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/crypto/hisilicon/sec/sec_algs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static int sec_alg_skcipher_crypto(struct skcipher_request *skreq,
844844
if (crypto_skcipher_ivsize(atfm))
845845
dma_unmap_single(info->dev, sec_req->dma_iv,
846846
crypto_skcipher_ivsize(atfm),
847-
DMA_BIDIRECTIONAL);
847+
DMA_TO_DEVICE);
848848
err_unmap_out_sg:
849849
if (split)
850850
sec_unmap_sg_on_err(skreq->dst, steps, splits_out,

0 commit comments

Comments
 (0)