net80211: do not reschedule scan_curchan_task() if the scan was canceled.

This should fix possible use-after-free in the scheduled task.

PR:		208605
This commit is contained in:
Andriy Voskoboinyk 2016-04-19 20:19:21 +00:00
parent 260111ffce
commit 2cd9502778
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298293

View File

@ -736,8 +736,11 @@ scan_curchan_task(void *arg, int pending)
/* clear mindwell lock and initial channel change flush */
ss_priv->ss_iflags &= ~ISCAN_REP;
if (ss_priv->ss_iflags & (ISCAN_CANCEL|ISCAN_ABORT))
if (ss_priv->ss_iflags & (ISCAN_CANCEL|ISCAN_ABORT)) {
taskqueue_cancel_timeout(ic->ic_tq, &ss_priv->ss_scan_curchan,
NULL);
goto end;
}
IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN, "%s: waiting\n",
__func__);