summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorJia Jie Ho <jiajie.ho@starfivetech.com>2024-06-26 09:40:43 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2024-07-06 10:20:00 +1000
commit8323c036789b8b4a61925fce439a89dba17b7f2f (patch)
tree4eec578cfc4196558e8a0944eea680cf7698348d /drivers/crypto
parent6aad7019f697ab0bed98eba737d19bd7f67713de (diff)
crypto: starfive - Fix nent assignment in rsa dec
Missing src scatterlist nent assignment in rsa decrypt function. Removing all unneeded assignment and use nents value from req->src instead. Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/starfive/jh7110-cryp.h1
-rw-r--r--drivers/crypto/starfive/jh7110-rsa.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/starfive/jh7110-cryp.h b/drivers/crypto/starfive/jh7110-cryp.h
index 85c65c6c0327..5ed4ba5da7f9 100644
--- a/drivers/crypto/starfive/jh7110-cryp.h
+++ b/drivers/crypto/starfive/jh7110-cryp.h
@@ -218,7 +218,6 @@ struct starfive_cryp_request_ctx {
struct scatterlist *out_sg;
struct ahash_request ahash_fbk_req;
size_t total;
- size_t nents;
unsigned int blksize;
unsigned int digsize;
unsigned long in_sg_len;
diff --git a/drivers/crypto/starfive/jh7110-rsa.c b/drivers/crypto/starfive/jh7110-rsa.c
index 59f5979e9360..a778c4846025 100644
--- a/drivers/crypto/starfive/jh7110-rsa.c
+++ b/drivers/crypto/starfive/jh7110-rsa.c
@@ -259,7 +259,7 @@ static int starfive_rsa_enc_core(struct starfive_cryp_ctx *ctx, int enc)
memset(rctx->rsa_data, 0, shift);
}
- rctx->total = sg_copy_to_buffer(rctx->in_sg, rctx->nents,
+ rctx->total = sg_copy_to_buffer(rctx->in_sg, sg_nents(rctx->in_sg),
rctx->rsa_data + shift, rctx->total);
if (enc) {
@@ -309,7 +309,6 @@ static int starfive_rsa_enc(struct akcipher_request *req)
rctx->in_sg = req->src;
rctx->out_sg = req->dst;
rctx->total = req->src_len;
- rctx->nents = sg_nents(rctx->in_sg);
ctx->rctx = rctx;
return starfive_rsa_enc_core(ctx, 1);