Commit 1ee57ab9 authored by Thomas Fourier's avatar Thomas Fourier Committed by Herbert Xu
Browse files

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: 915e4e84 ("crypto: hisilicon - SEC security accelerator driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarThomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a1b80018
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -844,7 +844,7 @@ static int sec_alg_skcipher_crypto(struct skcipher_request *skreq,
	if (crypto_skcipher_ivsize(atfm))
		dma_unmap_single(info->dev, sec_req->dma_iv,
				 crypto_skcipher_ivsize(atfm),
				 DMA_BIDIRECTIONAL);
				 DMA_TO_DEVICE);
err_unmap_out_sg:
	if (split)
		sec_unmap_sg_on_err(skreq->dst, steps, splits_out,