diff options
| author | Sergey Shtylyov <s.shtylyov@omp.ru> | 2025-12-17 23:21:43 +0300 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-12-29 08:48:35 +0800 |
| commit | eb6449aa7b32259a8b59e0c9602b32dcaf1fba58 (patch) | |
| tree | 0c2e76d9ca1a37e30b9c9f2a1cef2ad71d78bd87 /crypto | |
| parent | b6aa86c8a50883e2eab6f8a3a9d4e08a42519410 (diff) | |
crypto: drbg - kill useless variable in drbg_fips_continuous_test()
In drbg_fips_continuous_test(), not only the initializer of the ret local
variable is useless, the variable itself does not seem needed as it only
stores the result of memcmp() until it's checked on the next line -- get
rid of the variable...
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/drbg.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c index 1d433dae9955..ab7da601a87f 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -234,7 +234,6 @@ static int drbg_fips_continuous_test(struct drbg_state *drbg, const unsigned char *entropy) { unsigned short entropylen = drbg_sec_strength(drbg->core->flags); - int ret = 0; if (!IS_ENABLED(CONFIG_CRYPTO_FIPS)) return 0; @@ -253,8 +252,7 @@ static int drbg_fips_continuous_test(struct drbg_state *drbg, /* priming: another round is needed */ return -EAGAIN; } - ret = memcmp(drbg->prev, entropy, entropylen); - if (!ret) + if (!memcmp(drbg->prev, entropy, entropylen)) panic("DRBG continuous self test failed\n"); memcpy(drbg->prev, entropy, entropylen); |
