From 0402e2a32bda7e5680f4e8b98be22aa6ba1a9ca8 Mon Sep 17 00:00:00 2001 From: Christian kimocoder Date: Tue, 24 Oct 2017 16:29:48 +0200 Subject: [PATCH] adopt upstream: net: Fix inconsistent teardown net: Fix inconsistent teardown and release of private netdev state. commit id cf124db566e6b036b8bcbe8decbed740bdfac8c6 --- os_dep/linux/ioctl_cfg80211.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 759b38d..99ac279 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -749,7 +749,7 @@ check_bss: struct ieee80211_channel *notify_channel; u32 freq; u16 channel = cur_network->network.Configuration.DSConfig; - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) struct cfg80211_roam_info roam_info = {}; #endif @@ -758,7 +758,7 @@ check_bss: #endif RTW_INFO(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) roam_info.channel = notify_channel; roam_info.bssid = cur_network->network.MacAddress; roam_info.req_ie = @@ -3670,6 +3670,11 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(mon_ndev->name, name, IFNAMSIZ); 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, 9)) mon_ndev->needs_free_netdev = false; mon_ndev->priv_destructor = rtw_ndev_destructor; @@ -6446,7 +6451,7 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *adapter, struct wiphy *wiphy) #endif #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) - #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)) + #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12 ,0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; #else // kernel >= 4.12 wiphy->max_sched_scan_reqs = 1;