wlan: Prevent memory allocation when holding spin lock.
During APss(CPU3) power-collapse, WLAN Host Driver enter/exits
from IMPS. After entering/exiting from IMPS
hdd_conf_mcastbcast_filter() allocates memory
for wlanRxpFilterParam without unlocking spin lock.
CRs-Fixed: 601498
Change-Id: Ife3b3fe11b866e585ed6bbe562e49d38308e2176
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index e71460f..534ebb4 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -1253,9 +1253,11 @@
pHddCtx->hdd_ignore_dtim_enabled = TRUE;
}
spin_lock(&pHddCtx->filter_lock);
- if((newState == BMPS) && pHddCtx->hdd_wlan_suspended) {
+ if ((newState == BMPS) && pHddCtx->hdd_wlan_suspended)
+ {
spin_unlock(&pHddCtx->filter_lock);
- if (VOS_FALSE == pHddCtx->sus_res_mcastbcast_filter_valid) {
+ if (VOS_FALSE == pHddCtx->sus_res_mcastbcast_filter_valid)
+ {
pHddCtx->sus_res_mcastbcast_filter =
pHddCtx->configuredMcastBcastFilter;
pHddCtx->sus_res_mcastbcast_filter_valid = VOS_TRUE;
@@ -1281,16 +1283,23 @@
* resume request will be lost. So reconfigure the filters on detecting
* a change in the power state of the WCN chip.
*/
+ spin_unlock(&pHddCtx->filter_lock);
if (IMPS != newState)
{
+ spin_lock(&pHddCtx->filter_lock);
if (FALSE == pHddCtx->hdd_wlan_suspended)
{
+ spin_unlock(&pHddCtx->filter_lock);
hddLog(VOS_TRACE_LEVEL_INFO,
"Not in IMPS/BMPS and suspended state");
hdd_conf_mcastbcast_filter(pHddCtx, FALSE);
}
+ else
+ {
+ spin_unlock(&pHddCtx->filter_lock);
+ }
}
- spin_unlock(&pHddCtx->filter_lock);
+ }
}