On 9/11/24 00:03, Jakub Kicinski wrote:
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?
I considered moving the locking initialization and shutdown, but I kept
there for symmetry with the rss_lock. I'll move the init/destroy in the
next revision.
Thanks,
Paolo