Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 915e4e8413da ("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>

authored by

Thomas Fourier and committed by
Herbert Xu
1ee57ab9 a1b80018

+1 -1
+1 -1
drivers/crypto/hisilicon/sec/sec_algs.c
··· 844 844 if (crypto_skcipher_ivsize(atfm)) 845 845 dma_unmap_single(info->dev, sec_req->dma_iv, 846 846 crypto_skcipher_ivsize(atfm), 847 - DMA_BIDIRECTIONAL); 847 + DMA_TO_DEVICE); 848 848 err_unmap_out_sg: 849 849 if (split) 850 850 sec_unmap_sg_on_err(skreq->dst, steps, splits_out,