]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: hisilicon/sgl - fix inconsistent map/unmap direction issue
authorChenghai Huang <huangchenghai2@huawei.com>
Fri, 19 Dec 2025 03:36:19 +0000 (11:36 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 16 Jan 2026 06:02:06 +0000 (14:02 +0800)
Ensure that the direction for dma_map_sg and dma_unmap_sg is
consistent.

Fixes: 2566de3e06a3 ("crypto: hisilicon - Use fine grained DMA mapping direction")
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/sgl.c

index 24c7b6ab285ba6ad63170005b407743b6fc39a00..d41b34405c21c4b48871bc1be0d392eee8c0fda7 100644 (file)
@@ -260,7 +260,7 @@ hisi_acc_sg_buf_map_to_hw_sgl(struct device *dev, struct scatterlist *sgl,
        return curr_hw_sgl;
 
 err_unmap:
-       dma_unmap_sg(dev, sgl, sg_n, DMA_BIDIRECTIONAL);
+       dma_unmap_sg(dev, sgl, sg_n, dir);
 
        return ERR_PTR(ret);
 }