Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix page fault that occurs when we call CFG80211OS_ScanEnd too late #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions common/cmm_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,14 @@ INT RTMP_COM_IoctlHandle(

VIRTUAL_IF_DEC(pAd);
if (VIRTUAL_IF_NUM(pAd) == 0)
{
// When this occurs, it seems like most kernel code will want
// the scan to end. If this call is not here, we get both
// a kernel warning, and later an error when we try to end the
// scan later in the code.
CFG80211OS_ScanEnd(pAd->pCfg80211_CB, false);
pInfConf->rt28xx_close(pAd->net_dev);
}
}
break;

Expand Down
1 change: 1 addition & 0 deletions os/linux/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,7 @@ BOOLEAN CFG80211_Register(
/* allocate wireless device */
RTMP_DRIVER_80211_BANDINFO_GET(pAd, &BandInfo);

pCfg80211_CB->pCfg80211_ScanReq = NULL;
pCfg80211_CB->pCfg80211_Wdev = \
CFG80211_WdevAlloc(pCfg80211_CB, &BandInfo, pAd, pDev);
if (pCfg80211_CB->pCfg80211_Wdev == NULL)
Expand Down
5 changes: 4 additions & 1 deletion os/linux/rt_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -3222,7 +3222,10 @@ VOID CFG80211OS_ScanEnd(


CFG80211DBG(RT_DEBUG_ERROR, ("80211> cfg80211_scan_done\n"));
cfg80211_scan_done(pCfg80211_CB->pCfg80211_ScanReq, FlgIsAborted);
if (pCfg80211_CB->pCfg80211_ScanReq) { // prevent this from being called twice
cfg80211_scan_done(pCfg80211_CB->pCfg80211_ScanReq, FlgIsAborted);
pCfg80211_CB->pCfg80211_ScanReq = NULL;
}
#endif /* CONFIG_STA_SUPPORT */
#endif /* LINUX_VERSION_CODE */
}
Expand Down