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

Reply via email to