summaryrefslogtreecommitdiff
path: root/drivers/crypto/hisilicon/hpre
diff options
context:
space:
mode:
authorHui Tang <tanghui20@huawei.com>2021-03-19 13:45:05 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-26 12:15:57 +0300
commita9214b0b6ed245b0c5239e0576b7de509815c2a0 (patch)
treee91577fde9558cce5aa3e76b640e396f277a2059 /drivers/crypto/hisilicon/hpre
parented48466d3ff94fac09ca5c521a24501eb5908277 (diff)
downloadlinux-a9214b0b6ed245b0c5239e0576b7de509815c2a0.tar.xz
crypto: hisilicon - fix the check on dma address
System may be able to get physical address of zero if not reserved by firmware. The dma address obtained by 'dma_alloc_coherent' is valid, since already checking cpu va before, so do not check again. Signed-off-by: Hui Tang <tanghui20@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/hisilicon/hpre')
-rw-r--r--drivers/crypto/hisilicon/hpre/hpre_crypto.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
index b77473be5131..c90d0b82c3fa 100644
--- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c
+++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c
@@ -298,8 +298,6 @@ static void hpre_hw_data_clr_all(struct hpre_ctx *ctx,
dma_addr_t tmp;
tmp = le64_to_cpu(sqe->in);
- if (unlikely(!tmp))
- return;
if (src) {
if (req->src)
@@ -309,8 +307,6 @@ static void hpre_hw_data_clr_all(struct hpre_ctx *ctx,
}
tmp = le64_to_cpu(sqe->out);
- if (unlikely(!tmp))
- return;
if (req->dst) {
if (dst)
@@ -1358,15 +1354,11 @@ static void hpre_ecdh_hw_data_clr_all(struct hpre_ctx *ctx,
dma_addr_t dma;
dma = le64_to_cpu(sqe->in);
- if (unlikely(!dma))
- return;
if (src && req->src)
dma_free_coherent(dev, ctx->key_sz << 2, req->src, dma);
dma = le64_to_cpu(sqe->out);
- if (unlikely(!dma))
- return;
if (req->dst)
dma_free_coherent(dev, ctx->key_sz << 1, req->dst, dma);
@@ -1657,15 +1649,11 @@ static void hpre_curve25519_hw_data_clr_all(struct hpre_ctx *ctx,
dma_addr_t dma;
dma = le64_to_cpu(sqe->in);
- if (unlikely(!dma))
- return;
if (src && req->src)
dma_free_coherent(dev, ctx->key_sz, req->src, dma);
dma = le64_to_cpu(sqe->out);
- if (unlikely(!dma))
- return;
if (req->dst)
dma_free_coherent(dev, ctx->key_sz, req->dst, dma);