Commit 5c4e1d18 authored by Michal Schmidt's avatar Michal Schmidt Committed by Jakub Kicinski

iavf: use unregister_netdev

Use unregister_netdev, which takes rtnl_lock for us. We don't have to
check the reg_state under rtnl_lock. There's nothing to race with. We
have just cancelled the finish_config work.
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231027175941.1340255-7-jacob.e.keller@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 34ad34bf
...@@ -5167,10 +5167,8 @@ static void iavf_remove(struct pci_dev *pdev) ...@@ -5167,10 +5167,8 @@ static void iavf_remove(struct pci_dev *pdev)
cancel_delayed_work_sync(&adapter->watchdog_task); cancel_delayed_work_sync(&adapter->watchdog_task);
cancel_work_sync(&adapter->finish_config); cancel_work_sync(&adapter->finish_config);
rtnl_lock();
if (netdev->reg_state == NETREG_REGISTERED) if (netdev->reg_state == NETREG_REGISTERED)
unregister_netdevice(netdev); unregister_netdev(netdev);
rtnl_unlock();
if (CLIENT_ALLOWED(adapter)) { if (CLIENT_ALLOWED(adapter)) {
err = iavf_lan_del_device(adapter); err = iavf_lan_del_device(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment