summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/hmac.c4
-rw-r--r--crypto/jitterentropy-kcapi.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/crypto/hmac.c b/crypto/hmac.c
index a68c1266121f..ac8c611ee33e 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -157,6 +157,10 @@ static int hmac_init_tfm(struct crypto_tfm *tfm)
parent->descsize = sizeof(struct shash_desc) +
crypto_shash_descsize(hash);
+ if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) {
+ crypto_free_shash(hash);
+ return -EINVAL;
+ }
ctx->hash = hash;
return 0;
diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c
index 699db1726ead..701b8d86ab49 100644
--- a/crypto/jitterentropy-kcapi.c
+++ b/crypto/jitterentropy-kcapi.c
@@ -193,7 +193,7 @@ static void __exit jent_mod_exit(void)
crypto_unregister_rng(&jent_alg);
}
-subsys_initcall(jent_mod_init);
+module_init(jent_mod_init);
module_exit(jent_mod_exit);
MODULE_LICENSE("Dual BSD/GPL");