From 5b87f619cc5c0a55dcd85ce97974e3f5b9333b7b Mon Sep 17 00:00:00 2001 From: Weili Qian Date: Fri, 18 Sep 2026 20:27:21 +0800 Subject: [PATCH] crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH In hpre_ecdh_hw_data_clr_all(), req->dst is always NULL because hpre_ecdh_dst_data_init() sets hpre_req->dst = NULL before mapping the user buffer with dma_map_single(). The dma_free_coherent() call on req->dst is therefore dead code. Remove it. Fixes: 05e7b906aa7c ("crypto: hisilicon/hpre - add 'ECDH' algorithm") Signed-off-by: Weili Qian Signed-off-by: Herbert Xu --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 7894211b9972..8551d6ccb78d 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -1407,8 +1407,6 @@ static void hpre_ecdh_hw_data_clr_all(struct hpre_ctx *ctx, if (unlikely(dma_mapping_error(dev, dma))) return; - if (req->dst) - dma_free_coherent(dev, ctx->key_sz << 1, req->dst, dma); if (dst) dma_unmap_single(dev, dma, ctx->key_sz << 1, DMA_FROM_DEVICE); }