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

crypto: aspeed - Fix dma_unmap_sg() direction

It seems like everywhere in this file, when the request is not
bidirectionala, req->src is mapped with DMA_TO_DEVICE and req->dst is
mapped with DMA_FROM_DEVICE.

Fixes: 62f58b1637b7 ("crypto: aspeed - add HACE crypto driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thomas Fourier and committed by
Herbert Xu
838d2d51 bee8a520

+1 -1
+1 -1
drivers/crypto/aspeed/aspeed-hace-crypto.c
··· 346 346 347 347 } else { 348 348 dma_unmap_sg(hace_dev->dev, req->dst, rctx->dst_nents, 349 - DMA_TO_DEVICE); 349 + DMA_FROM_DEVICE); 350 350 dma_unmap_sg(hace_dev->dev, req->src, rctx->src_nents, 351 351 DMA_TO_DEVICE); 352 352 }