summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandrasekaran, Manishekar <cmshekar@qti.qualcomm.com>2014-05-15 15:54:45 +0530
committerPitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com>2014-05-16 15:50:12 +0530
commit34723d9f384e5ea702d217d13a508cc342a6fe70 (patch)
tree05434562a93e72b1a31ccead15429b1360b8d6b4
parentdbb1cccc60307aebe610797b260ec09e15b30079 (diff)
qcacld: Return correct error code when max interface is reached
Currently SME is returning success even though it fails to create session because of max session limit being reached. This results in stale adaptor in HDD without having corresponding SME session. While unloading driver we are trying to stop this stale adaptor which results in crash. So return proper error status in SME when it fail to create the session. Change-Id: I3c836f802011767a8e1071283cd0dabaae0d83b7 CRs-Fixed: 664722
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c2
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c16
2 files changed, 10 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 1aef73fc8220..09d4492ba28a 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -10884,7 +10884,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc)
#endif
pHddCtx->current_intf_count=0;
- pHddCtx->max_intf_count = WLAN_MAX_INTERFACES;
+ pHddCtx->max_intf_count = CSR_ROAM_SESSION_MAX;
#ifndef QCA_WIFI_2_0
pHddCtx->cfg_ini->maxWoWFilters = WOWL_MAX_PTRNS_ALLOWED;
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 4b6654b695a9..243ab039f6b2 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -14451,16 +14451,16 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac,
tCsrRoamSession *pSession;
*pbSessionId = CSR_SESSION_ID_INVALID;
- for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
+ for( i = 0; i < pMac->sme.max_intf_count; i++ )
{
- if ((v_U8_t)i >= pMac->sme.max_intf_count) {
- smsLog(pMac, LOGE, "%s: Reached max interfaces! Session creation will fail", __func__);
- break;
- }
-
if( !CSR_IS_SESSION_VALID( pMac, i ) )
{
pSession = CSR_GET_SESSION( pMac, i );
+ if (!pSession)
+ {
+ smsLog(pMac, LOGE, FL("Session does not exist for interface %d"), i);
+ break;
+ }
status = eHAL_STATUS_SUCCESS;
pSession->sessionActive = eANI_BOOLEAN_TRUE;
pSession->sessionId = (tANI_U8)i;
@@ -14505,9 +14505,11 @@ eHalStatus csrRoamOpenSession(tpAniSirGlobal pMac,
break;
}
}
- if( CSR_ROAM_SESSION_MAX == i )
+ if( pMac->sme.max_intf_count == i )
{
//No session is available
+ smsLog(pMac, LOGE, "%s: Reached max interfaces: %d! Session creation will fail",
+ __func__, pMac->sme.max_intf_count);
status = eHAL_STATUS_RESOURCES;
}
return ( status );