# Re: \[PATCH v7 net-next 14/15\] iavf: Add net\_shaper\_ops support

- From: Jakub Kicinski \<kuba@kernel.org\>
- Date: 2024-09-10 22:03:39 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/09/11306067
- Thread: https://ratatoskr.run/netdev/2024/09/11305949/t.md

```text
On Tue, 10 Sep 2024 00:10:08 +0200 Paolo Abeni wrote:
> +	if (adapter->netdev->reg_state == NETREG_REGISTERED) {
> +		mutex_lock(&adapter->netdev->lock);
> +		devlock = true;
> +	}

This leads to a false positive in cocci.

Any concerns about moving the mutex_init() / _destroy() into
alloc_netdev_mqs() / free_netdev()?  I guess one could argue
that narrower scope of the lock being valid may help catching 
errors, but I think we'll instead end up with more checks like
the above sprinkled around than bugs caught?
```
