Commit 0e2b6286 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: cancel the connection monitor timers/work

In "mac80211: monitor the connection" I forgot to
add code to cancel the new timers & work when the
interface is brought down, which isn't a problem
if you just bring it down, but _is_ a problem when
you destroy the interface. Correct this lapse.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ec96cfd8
...@@ -449,16 +449,18 @@ static int ieee80211_stop(struct net_device *dev) ...@@ -449,16 +449,18 @@ static int ieee80211_stop(struct net_device *dev)
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
del_timer_sync(&sdata->u.mgd.chswitch_timer); del_timer_sync(&sdata->u.mgd.chswitch_timer);
del_timer_sync(&sdata->u.mgd.timer); del_timer_sync(&sdata->u.mgd.timer);
del_timer_sync(&sdata->u.mgd.conn_mon_timer);
del_timer_sync(&sdata->u.mgd.bcn_mon_timer);
/* /*
* If the timer fired while we waited for it, it will have * If any of the timers fired while we waited for it, it will
* requeued the work. Now the work will be running again * have queued its work. Now the work will be running again
* but will not rearm the timer again because it checks * but will not rearm the timer again because it checks
* whether the interface is running, which, at this point, * whether the interface is running, which, at this point,
* it no longer is. * it no longer is.
*/ */
cancel_work_sync(&sdata->u.mgd.work); cancel_work_sync(&sdata->u.mgd.work);
cancel_work_sync(&sdata->u.mgd.chswitch_work); cancel_work_sync(&sdata->u.mgd.chswitch_work);
cancel_work_sync(&sdata->u.mgd.monitor_work);
cancel_work_sync(&sdata->u.mgd.beacon_loss_work); cancel_work_sync(&sdata->u.mgd.beacon_loss_work);
/* /*
......
...@@ -1163,6 +1163,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata, ...@@ -1163,6 +1163,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
const u8 *ssid; const u8 *ssid;
bool already = false; bool already = false;
if (!netif_running(sdata->dev))
return;
mutex_lock(&ifmgd->mtx); mutex_lock(&ifmgd->mtx);
if (!ifmgd->associated) if (!ifmgd->associated)
......
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