diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 355ee29aa6..e8988680de 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7887,7 +7887,7 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, uint32_t roamId = 0; bool fCallCallback = false; tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); - tSirBssDescription first_ap_profile; + tSirBssDescription *first_ap_profile; if (NULL == pSession) { sme_err("session does not exist for given sessionId: %d", @@ -7899,6 +7899,13 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, sme_err("No profile specified"); return QDF_STATUS_E_FAILURE; } + + first_ap_profile = qdf_mem_malloc(sizeof(*first_ap_profile)); + if (NULL == first_ap_profile) { + sme_err("malloc fails for first_ap_profile"); + return QDF_STATUS_E_NOMEM; + } + /* Initialize the count before proceeding with the Join requests */ pSession->join_bssid_count = 0; sme_debug( @@ -7989,9 +7996,9 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId, if ((pScanFilter->csrPersona == QDF_STA_MODE) || (pScanFilter->csrPersona == QDF_P2P_CLIENT_MODE)) { csr_get_bssdescr_from_scan_handle(hBSSList, - &first_ap_profile); + first_ap_profile); status = policy_mgr_handle_conc_multiport(pMac->psoc, - sessionId, first_ap_profile.channelId); + sessionId, first_ap_profile->channelId); if ((QDF_IS_STATUS_SUCCESS(status)) && (!csr_wait_for_connection_update(pMac, true))) { sme_debug("conn update error"); @@ -8058,6 +8065,8 @@ end: csr_roam_call_callback(pMac, sessionId, NULL, roamId, eCSR_ROAM_FAILED, eCSR_ROAM_RESULT_FAILURE); } + qdf_mem_free(first_ap_profile); + return status; } @@ -13958,8 +13967,7 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, tSirMacRateSet ExRateSet; tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); uint32_t dwTmp, ucDot11Mode = 0; - /* RSN MAX is bigger than WPA MAX */ - uint8_t wpaRsnIE[DOT11F_IE_RSN_MAX_LEN]; + uint8_t *wpaRsnIE = NULL; uint8_t txBFCsnValue = 0; tSirSmeJoinReq *csr_join_req; tSirMacCapabilityInfo *pAP_capabilityInfo; @@ -14027,6 +14035,14 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, status = QDF_STATUS_SUCCESS; if (!QDF_IS_STATUS_SUCCESS(status)) break; + + wpaRsnIE = qdf_mem_malloc(DOT11F_IE_RSN_MAX_LEN); + if (NULL == wpaRsnIE) + status = QDF_STATUS_E_NOMEM; + + if (!QDF_IS_STATUS_SUCCESS(status)) + break; + csr_join_req->messageType = messageType; csr_join_req->length = msgLen; csr_join_req->sessionId = (uint8_t) sessionId; @@ -14693,6 +14709,9 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, if (!QDF_IS_STATUS_SUCCESS(status) && (NULL != csr_join_req)) qdf_mem_free(csr_join_req); + if (wpaRsnIE) + qdf_mem_free(wpaRsnIE); + return status; }