kernel/crypto/algapi.c
.. .. @@ -456,7 +456,9 @@ 456 456 if (WARN(ret, "Algorithm %s is not registered", alg->cra_driver_name)) 457 457 return; 458 458 459 - BUG_ON(refcount_read(&alg->cra_refcnt) != 1);459 + if (WARN_ON(refcount_read(&alg->cra_refcnt) != 1))460 + return;461 +460 462 if (alg->cra_destroy) 461 463 alg->cra_destroy(alg); 462 464