Skip to content

Commit ae87660

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes a regression that breaks the jitterentropy RNG and a potential memory leak in hmac" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: hmac - fix memory leak in hmac_init_tfm() crypto: jitterentropy - change back to module_init()
2 parents 0104763 + 7829a0c commit ae87660

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎crypto/hmac.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,10 @@ static int hmac_init_tfm(struct crypto_tfm *tfm)
152152

153153
parent->descsize = sizeof(struct shash_desc) +
154154
crypto_shash_descsize(hash);
155-
if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE))
155+
if (WARN_ON(parent->descsize > HASH_MAX_DESCSIZE)) {
156+
crypto_free_shash(hash);
156157
return -EINVAL;
158+
}
157159

158160
ctx->hash = hash;
159161
return 0;

‎crypto/jitterentropy-kcapi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void __exit jent_mod_exit(void)
198198
crypto_unregister_rng(&jent_alg);
199199
}
200200

201-
subsys_initcall(jent_mod_init);
201+
module_init(jent_mod_init);
202202
module_exit(jent_mod_exit);
203203

204204
MODULE_LICENSE("Dual BSD/GPL");

0 commit comments

Comments
 (0)