summaryrefslogtreecommitdiffstats
path: root/crypto/rng.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rng.c')
-rw-r--r--crypto/rng.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/rng.c b/crypto/rng.c
index 2406501b90b7..33c38a72bff5 100644
--- a/crypto/rng.c
+++ b/crypto/rng.c
@@ -35,9 +35,11 @@ static int crypto_default_rng_refcnt;
35 35
36int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) 36int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen)
37{ 37{
38 struct crypto_alg *alg = tfm->base.__crt_alg;
38 u8 *buf = NULL; 39 u8 *buf = NULL;
39 int err; 40 int err;
40 41
42 crypto_stats_get(alg);
41 if (!seed && slen) { 43 if (!seed && slen) {
42 buf = kmalloc(slen, GFP_KERNEL); 44 buf = kmalloc(slen, GFP_KERNEL);
43 if (!buf) 45 if (!buf)
@@ -50,7 +52,7 @@ int crypto_rng_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen)
50 } 52 }
51 53
52 err = crypto_rng_alg(tfm)->seed(tfm, seed, slen); 54 err = crypto_rng_alg(tfm)->seed(tfm, seed, slen);
53 crypto_stat_rng_seed(tfm, err); 55 crypto_stats_rng_seed(alg, err);
54out: 56out:
55 kzfree(buf); 57 kzfree(buf);
56 return err; 58 return err;