…
> +++ b/drivers/crypto/ti/mcrc64.c
…
> +static int mcrc64_probe(struct platform_device *pdev)
> +{
…
> + platform_set_drvdata(pdev, dev_data);
> +
> + spin_lock(&mcrc64_dev_list.lock);
> + list_add(&dev_data->list, &mcrc64_dev_list.dev_list);
> + spin_unlock(&mcrc64_dev_list.lock);
> +
> + mutex_lock(&refcnt_lock);
> + if (!refcnt) {
> + ret = crypto_register_shashes(algs, ARRAY_SIZE(algs));
…
> + }
> + refcnt++;
> + mutex_unlock(&refcnt_lock);
…
Would you become interested to apply lock guards?
https://elixir.bootlin.com/linux/v6.10-rc2/source/include/linux/cleanup.h#L124
Regards,
Markus