diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2022-11-22 18:06:56 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2022-12-02 18:12:40 +0800 |
commit | cb99fc0dd1f6985e8b6ade93e3d69f5e33930539 (patch) | |
tree | 23d0004fca34cf2ccaaf48101527b549214cca50 /crypto | |
parent | 3e71e5b0efcc730216f4450b796df4fdd627ecd0 (diff) | |
download | linux-starfive-cb99fc0dd1f6985e8b6ade93e3d69f5e33930539.tar.gz linux-starfive-cb99fc0dd1f6985e8b6ade93e3d69f5e33930539.tar.bz2 linux-starfive-cb99fc0dd1f6985e8b6ade93e3d69f5e33930539.zip |
crypto: dh - Use helper to set reqsize
The value of reqsize must only be changed through the helper.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/dh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/dh.c b/crypto/dh.c index 99c3b2ef7adc..e39c1bde1ac0 100644 --- a/crypto/dh.c +++ b/crypto/dh.c @@ -318,6 +318,9 @@ static int dh_safe_prime_init_tfm(struct crypto_kpp *tfm) if (IS_ERR(tfm_ctx->dh_tfm)) return PTR_ERR(tfm_ctx->dh_tfm); + kpp_set_reqsize(tfm, sizeof(struct kpp_request) + + crypto_kpp_reqsize(tfm_ctx->dh_tfm)); + return 0; } @@ -593,7 +596,6 @@ static int __maybe_unused __dh_safe_prime_create( inst->alg.max_size = dh_safe_prime_max_size; inst->alg.init = dh_safe_prime_init_tfm; inst->alg.exit = dh_safe_prime_exit_tfm; - inst->alg.reqsize = sizeof(struct kpp_request) + dh_alg->reqsize; inst->alg.base.cra_priority = dh_alg->base.cra_priority; inst->alg.base.cra_module = THIS_MODULE; inst->alg.base.cra_ctxsize = sizeof(struct dh_safe_prime_tfm_ctx); |