diff options
author | Adrian-Ken Rueegsegger <rueegsegger@swiss-it.ch> | 2009-02-05 16:19:31 +1100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-02-05 16:19:31 +1100 |
commit | 04a829c4e1c83e4f81c181735d873c46c8f8cc84 (patch) | |
tree | 17ed54aed0d9579787272f237ab6c44716aa71ce | |
parent | f0113c0278dc0cf64214883a6ad9138587edeb7b (diff) | |
download | linux-crypto-04a829c4e1c83e4f81c181735d873c46c8f8cc84.tar.gz linux-crypto-04a829c4e1c83e4f81c181735d873c46c8f8cc84.zip |
crypto: shash - Fix module refcount
Module reference counting for shash is incorrect: when
a new shash transformation is created the refcount is not
increased as it should.
Signed-off-by: Adrian-Ken Rueegsegger <rueegsegger@swiss-it.ch>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | crypto/shash.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index c9df3673..d5a2b619 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -388,10 +388,15 @@ static int crypto_init_shash_ops_compat(struct crypto_tfm *tfm) struct shash_desc *desc = crypto_tfm_ctx(tfm); struct crypto_shash *shash; + if (!crypto_mod_get(calg)) + return -EAGAIN; + shash = __crypto_shash_cast(crypto_create_tfm( calg, &crypto_shash_type)); - if (IS_ERR(shash)) + if (IS_ERR(shash)) { + crypto_mod_put(calg); return PTR_ERR(shash); + } desc->tfm = shash; tfm->exit = crypto_exit_shash_ops_compat; |