adopt upstream: net: Fix inconsistent teardown

This commit is contained in:
kimocoder 2018-08-04 20:09:03 +02:00
parent 6b80d73669
commit 79e44be3d0

View File

@ -4162,6 +4162,11 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
strncpy(mon_ndev->name, name, IFNAMSIZ); strncpy(mon_ndev->name, name, IFNAMSIZ);
mon_ndev->name[IFNAMSIZ - 1] = 0; mon_ndev->name[IFNAMSIZ - 1] = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12 ,0))
mon_ndev->needs_free_netdev = true;
#else
mon_ndev->destructor = rtw_ndev_destructor;
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8)) #if (LINUX_VERSION_CODE > KERNEL_VERSION(4, 11, 8))
mon_ndev->priv_destructor = rtw_ndev_destructor; mon_ndev->priv_destructor = rtw_ndev_destructor;
#else #else