diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-13 13:08:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-13 13:08:01 -0700 |
commit | 0b4d1afc94f1724db95c365d3e36f1578ac96dbc (patch) | |
tree | 847b6201e4f0cb808dd111cc6830039a6d69ca95 /crypto/api.c | |
parent | 7f32197e5e5fbb3b6681a3aae1e5a07aa4e5aaa8 (diff) | |
parent | a13f0cd0de008cb151bc99a4c7d12d1916118187 (diff) | |
download | linux-crypto-0b4d1afc94f1724db95c365d3e36f1578ac96dbc.tar.gz linux-crypto-0b4d1afc94f1724db95c365d3e36f1578ac96dbc.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (35 commits)
hwrng: timeriomem - Fix potential oops (request_mem_region/__devinit)
crypto: api - Use formatting of module name
crypto: testmgr - Allow hash test vectors longer than a page
crypto: testmgr - Check all test vector lengths
crypto: hifn_795x - fix __dev{init,exit} markings
crypto: tcrypt - Do not exit on success in fips mode
crypto: compress - Return produced bytes in crypto_{,de}compress_{update,final}
hwrng: via_rng - Support VIA Nano hardware RNG on X86_64 builds
hwrng: via_rng - Support VIA Nano hardware RNG
hwrng: via_rng - The VIA Hardware RNG driver is for the CPU, not Chipset
crypto: testmgr - Skip algs not flagged fips_allowed in fips mode
crypto: testmgr - Mark algs allowed in fips mode
crypto: testmgr - Add ctr(aes) test vectors
crypto: testmgr - Dynamically allocate xbuf and axbuf
crypto: testmgr - Print self-test pass notices in fips mode
crypto: testmgr - Catch base cipher self-test failures in fips mode
crypto: testmgr - Add ansi_cprng test vectors
crypto: testmgr - Add infrastructure for ansi_cprng self-tests
crypto: testmgr - Add self-tests for rfc4309(ccm(aes))
crypto: testmgr - Handle AEAD test vectors expected to fail verification
...
Diffstat (limited to 'crypto/api.c')
-rw-r--r-- | crypto/api.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/crypto/api.c b/crypto/api.c index fd2545de..d5944f92 100644 --- a/crypto/api.c +++ b/crypto/api.c @@ -217,14 +217,11 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) alg = crypto_alg_lookup(name, type, mask); if (!alg) { - char tmp[CRYPTO_MAX_ALG_NAME]; - - request_module(name); + request_module("%s", name); if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask & - CRYPTO_ALG_NEED_FALLBACK) && - snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp)) - request_module(tmp); + CRYPTO_ALG_NEED_FALLBACK)) + request_module("%s-all", name); alg = crypto_alg_lookup(name, type, mask); } @@ -580,20 +577,17 @@ EXPORT_SYMBOL_GPL(crypto_alloc_tfm); void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm) { struct crypto_alg *alg; - int size; if (unlikely(!mem)) return; alg = tfm->__crt_alg; - size = ksize(mem); if (!tfm->exit && alg->cra_exit) alg->cra_exit(tfm); crypto_exit_ops(tfm); crypto_mod_put(alg); - memset(mem, 0, size); - kfree(mem); + kzfree(mem); } EXPORT_SYMBOL_GPL(crypto_destroy_tfm); |