crypto: hisilicon - Fix dma_unmap_single() direction
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Signed-off-by Thomas Fourier <[email protected]>
--- drivers/crypto/hisilicon/sec/sec_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/hisilicon/sec/sec_algs.c +1 -1
@@ -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,
Signature · 1 line
2.43.0
Quoted 8 lines · Thomas Fourier
The direction used to map the buffer
skreq->ivisDMA_TO_DEVICEbut it is unmapped with directionDMA_BIDIRECTIONALin the error path.Change the unmap to match the mapping.
Fixes 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver")Cc <[email protected]>Signed-off-by Thomas Fourier <[email protected]>
LGTM, thanks.
Reviewed-by Thorsten Blum <[email protected]>
Herbert Xu
maintainerQuoted 11 lines · Thomas Fourier
The direction used to map the buffer
skreq->ivisDMA_TO_DEVICEbut it is unmapped with directionDMA_BIDIRECTIONALin the error path.Change the unmap to match the mapping.
Fixes 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver")Cc <[email protected]>Signed-off-by Thomas Fourier <[email protected]>--- drivers/crypto/hisilicon/sec/sec_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt