Re: [PATCH] crypto: Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux