On Sat, Mar 11, 2023 at 05:25:12PM +0100, Toke Høiland-Jørgensen wrote:
diff --git a/crypto/algapi.c b/crypto/algapi.c index d08f864f08be..e9954fcb61be 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -493,7 +493,7 @@ 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);
- WARN_ON(refcount_read(&alg->cra_refcnt) != 1);
I think we should return here instead of continuing to destroy the algorithm since we know that it's still in use.
Thanks,