diff options
author | James Morris <james.l.morris@oracle.com> | 2013-01-07 12:06:43 +1100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2013-01-07 12:06:43 +1100 |
commit | ca10c662b0ec80db86864277a94889cc63bae958 (patch) | |
tree | daaf99d935098038fd66e1bd238dcd3746dc5ea4 /crypto/shash.c | |
parent | fb6e03d937365cba54d5d8d923158562169ebfd1 (diff) | |
parent | 1c11ed58397f048d8187222927092b397a149d70 (diff) | |
download | linux-crypto-ca10c662b0ec80db86864277a94889cc63bae958.tar.gz linux-crypto-ca10c662b0ec80db86864277a94889cc63bae958.zip |
Merge tag 'v3.8-rc2' into next
Sync to Linus' tree.
Linux 3.8-rc2
Diffstat (limited to 'crypto/shash.c')
-rw-r--r-- | crypto/shash.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index 32067f47..f426330f 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -629,6 +629,42 @@ int crypto_unregister_shash(struct shash_alg *alg) } EXPORT_SYMBOL_GPL(crypto_unregister_shash); +int crypto_register_shashes(struct shash_alg *algs, int count) +{ + int i, ret; + + for (i = 0; i < count; i++) { + ret = crypto_register_shash(&algs[i]); + if (ret) + goto err; + } + + return 0; + +err: + for (--i; i >= 0; --i) + crypto_unregister_shash(&algs[i]); + + return ret; +} +EXPORT_SYMBOL_GPL(crypto_register_shashes); + +int crypto_unregister_shashes(struct shash_alg *algs, int count) +{ + int i, ret; + + for (i = count - 1; i >= 0; --i) { + ret = crypto_unregister_shash(&algs[i]); + if (ret) + pr_err("Failed to unregister %s %s: %d\n", + algs[i].base.cra_driver_name, + algs[i].base.cra_name, ret); + } + + return 0; +} +EXPORT_SYMBOL_GPL(crypto_unregister_shashes); + int shash_register_instance(struct crypto_template *tmpl, struct shash_instance *inst) { |