summaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 314e00f70e3..a0a67970461 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -321,6 +321,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
}
INIT_WORK(&drv->rfkill_sync, cfg80211_rfkill_sync_work);
+ INIT_WORK(&drv->conn_work, cfg80211_conn_work);
/*
* Initialize wiphy parameters to IEEE 802.11 MIB default values.
@@ -481,6 +482,8 @@ void wiphy_unregister(struct wiphy *wiphy)
/* unlock again before freeing */
mutex_unlock(&drv->mtx);
+ cancel_work_sync(&drv->conn_work);
+
cfg80211_debugfs_drv_del(drv);
/* If this device got a regulatory hint tell core its
@@ -569,6 +572,10 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
break;
}
break;
+ case NETDEV_DOWN:
+ kfree(wdev->conn);
+ wdev->conn = NULL;
+ break;
case NETDEV_UP:
#ifdef CONFIG_WIRELESS_EXT
if (wdev->iftype != NL80211_IFTYPE_ADHOC)