brcmfmac: Fix escan timer causing oops.
authorHante Meuleman <meuleman@broadcom.com>
Fri, 6 Feb 2015 17:36:47 +0000 (18:36 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 26 Feb 2015 13:14:23 +0000 (15:14 +0200)
In some rare circumstances the escan protection timer can expire
before the setup completed (due to long timeouts on IOCTL). This
patch avoids this situation by setting the timer after the setup
completed correctly.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c

index bc86009e90fa45e5cd634a89fd527f2d14b15a36..33245bbb722492fecd77a7588f1285a18b70ee1d 100644 (file)
@@ -1050,10 +1050,6 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
        if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
                vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
 
-       /* Arm scan timeout timer */
-       mod_timer(&cfg->escan_timeout, jiffies +
-                       WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
-
        escan_req = false;
        if (request) {
                /* scan bss */
@@ -1112,12 +1108,14 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
                }
        }
 
+       /* Arm scan timeout timer */
+       mod_timer(&cfg->escan_timeout, jiffies +
+                       WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
+
        return 0;
 
 scan_out:
        clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
-       if (timer_pending(&cfg->escan_timeout))
-               del_timer_sync(&cfg->escan_timeout);
        cfg->scan_request = NULL;
        return err;
 }