mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2024-12-24 09:01:35 +00:00
fix netdev (un)registration deadlock
This commit is contained in:
parent
358f13d174
commit
14a60a7399
@ -5060,7 +5060,11 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
|
||||
mon_wdev->iftype = NL80211_IFTYPE_MONITOR;
|
||||
mon_ndev->ieee80211_ptr = mon_wdev;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
ret = cfg80211_register_netdevice(mon_ndev);
|
||||
#else
|
||||
ret = register_netdevice(mon_ndev);
|
||||
#endif
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@ -6762,7 +6766,11 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy,
|
||||
pwdev_priv = adapter_wdev_data(adapter);
|
||||
|
||||
if (ndev == pwdev_priv->pmon_ndev) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
cfg80211_unregister_netdevice(ndev);
|
||||
#else
|
||||
unregister_netdevice(ndev);
|
||||
#endif
|
||||
pwdev_priv->pmon_ndev = NULL;
|
||||
pwdev_priv->ifname_mon[0] = '\0';
|
||||
RTW_INFO(FUNC_NDEV_FMT" remove monitor ndev\n", FUNC_NDEV_ARG(ndev));
|
||||
|
@ -2192,7 +2192,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
|
||||
if (rtnl_lock_needed)
|
||||
ret = (register_netdev(ndev) == 0) ? _SUCCESS : _FAIL;
|
||||
else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
ret = (cfg80211_register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL;
|
||||
#else
|
||||
ret = (register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL;
|
||||
#endif
|
||||
|
||||
if (ret == _SUCCESS)
|
||||
adapter->registered = 1;
|
||||
@ -2241,7 +2245,11 @@ void rtw_os_ndev_unregister(_adapter *adapter)
|
||||
if (rtnl_lock_needed)
|
||||
unregister_netdev(netdev);
|
||||
else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
||||
cfg80211_unregister_netdevice(netdev);
|
||||
#else
|
||||
unregister_netdevice(netdev);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IOCTL_CFG80211) && !defined(RTW_SINGLE_WIPHY)
|
||||
|
Loading…
Reference in New Issue
Block a user