diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/algapi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index 9b7e263e..d7eb8f9e 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -491,7 +491,9 @@ void crypto_unregister_alg(struct crypto_alg *alg) if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name)) return; - BUG_ON(refcount_read(&alg->cra_refcnt) != 1); + if (WARN_ON(refcount_read(&alg->cra_refcnt) != 1)) + return; + if (alg->cra_destroy) alg->cra_destroy(alg); |