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:
avos 2016-04-19 20:19:21 +00:00
parent 1b24ba8d1f
commit 2cd2037927

View File

@ -736,8 +736,11 @@ scan_curchan_task(void *arg, int pending)
/* clear mindwell lock and initial channel change flush */ /* clear mindwell lock and initial channel change flush */
ss_priv->ss_iflags &= ~ISCAN_REP; 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; goto end;
}
IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN, "%s: waiting\n", IEEE80211_DPRINTF(ss->ss_vap, IEEE80211_MSG_SCAN, "%s: waiting\n",
__func__); __func__);