Message ID | 20150416030713.GA11668@gondor.apana.org.au (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Herbert Xu |
Headers | show |
On Wed, Apr 15, 2015 at 8:07 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote: > > Thanks! It actually appears to be a very simple bug that I somehow > missed during reviewing. Ok, this patch seems to fix it for me, so I undid my revert that I hadn't pushed out yet, and pushed out this instead. Thanks, Linus -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/crypto/algapi.c b/crypto/algapi.c index 2d0a1c6..d2627a3 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -525,12 +525,12 @@ int crypto_register_instance(struct crypto_template *tmpl, if (err) return err; - if (unlikely(!crypto_mod_get(&inst->alg))) - return -EAGAIN; - inst->alg.cra_module = tmpl->module; inst->alg.cra_flags |= CRYPTO_ALG_INSTANCE; + if (unlikely(!crypto_mod_get(&inst->alg))) + return -EAGAIN; + down_write(&crypto_alg_sem); larval = __crypto_register_alg(&inst->alg);