Re: [PATCH v2 3/3] drivers: crypto: add the Virtual Function driver for OcteonTX2 CPT

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

 



On Fri, Aug 07, 2020 at 07:39:20PM +0530, Srujana Challa wrote:
>
> +static inline int is_any_alg_used(void)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(otx2_cpt_skciphers); i++)
> +		if (refcount_read(&otx2_cpt_skciphers[i].base.cra_refcnt) != 1)
> +			return true;
> +	for (i = 0; i < ARRAY_SIZE(otx2_cpt_aeads); i++)
> +		if (refcount_read(&otx2_cpt_aeads[i].base.cra_refcnt) != 1)
> +			return true;
> +	return false;
> +}

This is racy as there is nothing stopping new users from coming in
after you've finished the test.

Cheers,
-- 
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]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux