Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

brcmfmac: Fix escan timer causing oops.

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>

authored by

Hante Meuleman and committed by
Kalle Valo
661fa95d a7b134a7

+4 -6
+4 -6
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
··· 1050 1050 if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif) 1051 1051 vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif; 1052 1052 1053 - /* Arm scan timeout timer */ 1054 - mod_timer(&cfg->escan_timeout, jiffies + 1055 - WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000); 1056 - 1057 1053 escan_req = false; 1058 1054 if (request) { 1059 1055 /* scan bss */ ··· 1108 1112 } 1109 1113 } 1110 1114 1115 + /* Arm scan timeout timer */ 1116 + mod_timer(&cfg->escan_timeout, jiffies + 1117 + WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000); 1118 + 1111 1119 return 0; 1112 1120 1113 1121 scan_out: 1114 1122 clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status); 1115 - if (timer_pending(&cfg->escan_timeout)) 1116 - del_timer_sync(&cfg->escan_timeout); 1117 1123 cfg->scan_request = NULL; 1118 1124 return err; 1119 1125 }