crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
[linux-2.6-microblaze.git] / crypto / algapi.c
index 9b7e263..d7eb8f9 100644 (file)
@@ -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);