mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
qcacld-3.0: Reduce stack frame size while processing auth frame
stack frame size of lim_process_auth_frame_no_session() is more than the default limit of 1024 bytes, so reduce stack frame size by allocating dynamic memory to tSirMacAuthFrameBody. Change-Id: I37bd23e1d5814950d9c1912a40058666e3de264f CRs-Fixed: 2844332
This commit is contained in:
parent
d9530115c9
commit
74930c306d
1 changed files with 26 additions and 17 deletions
|
|
@ -1711,15 +1711,14 @@ bool lim_process_sae_preauth_frame(struct mac_context *mac, uint8_t *rx_pkt)
|
|||
*
|
||||
***----------------------------------------------------------------------
|
||||
*/
|
||||
QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac, uint8_t *pBd,
|
||||
void *body)
|
||||
QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac,
|
||||
uint8_t *pBd, void *body)
|
||||
{
|
||||
tpSirMacMgmtHdr pHdr;
|
||||
struct pe_session *pe_session = NULL;
|
||||
uint8_t *pBody;
|
||||
uint16_t frameLen;
|
||||
tSirMacAuthFrameBody rxAuthFrame;
|
||||
tSirMacAuthFrameBody *pRxAuthFrameBody = NULL;
|
||||
tSirMacAuthFrameBody *rx_auth_frame;
|
||||
QDF_STATUS ret_status = QDF_STATUS_E_FAILURE;
|
||||
int i;
|
||||
bool sae_auth_frame;
|
||||
|
|
@ -1821,28 +1820,36 @@ QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac, uint8_t *p
|
|||
/* of our choice. */
|
||||
lim_deactivate_and_change_timer(mac, eLIM_FT_PREAUTH_RSP_TIMER);
|
||||
|
||||
rx_auth_frame = qdf_mem_malloc(sizeof(*rx_auth_frame));
|
||||
if (!rx_auth_frame) {
|
||||
lim_handle_ft_pre_auth_rsp(mac, QDF_STATUS_E_FAILURE, NULL, 0,
|
||||
pe_session);
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
/* Save off the auth resp. */
|
||||
if ((sir_convert_auth_frame2_struct(mac, pBody, frameLen, &rxAuthFrame) !=
|
||||
QDF_STATUS_SUCCESS)) {
|
||||
if ((sir_convert_auth_frame2_struct(mac, pBody, frameLen,
|
||||
rx_auth_frame) !=
|
||||
QDF_STATUS_SUCCESS)) {
|
||||
pe_err("failed to convert Auth frame to struct");
|
||||
lim_handle_ft_pre_auth_rsp(mac, QDF_STATUS_E_FAILURE, NULL, 0,
|
||||
pe_session);
|
||||
qdf_mem_free(rx_auth_frame);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
pRxAuthFrameBody = &rxAuthFrame;
|
||||
|
||||
pe_debug("Received Auth frame with type: %d seqnum: %d status: %d %d",
|
||||
(uint32_t) pRxAuthFrameBody->authAlgoNumber,
|
||||
(uint32_t) pRxAuthFrameBody->authTransactionSeqNumber,
|
||||
(uint32_t) pRxAuthFrameBody->authStatusCode,
|
||||
(uint32_t) mac->lim.gLimNumPreAuthContexts);
|
||||
switch (pRxAuthFrameBody->authTransactionSeqNumber) {
|
||||
(uint32_t)rx_auth_frame->authAlgoNumber,
|
||||
(uint32_t)rx_auth_frame->authTransactionSeqNumber,
|
||||
(uint32_t)rx_auth_frame->authStatusCode,
|
||||
(uint32_t)mac->lim.gLimNumPreAuthContexts);
|
||||
switch (rx_auth_frame->authTransactionSeqNumber) {
|
||||
case SIR_MAC_AUTH_FRAME_2:
|
||||
if (pRxAuthFrameBody->authStatusCode != STATUS_SUCCESS) {
|
||||
if (rx_auth_frame->authStatusCode != STATUS_SUCCESS) {
|
||||
pe_err("Auth status code received is %d",
|
||||
(uint32_t) pRxAuthFrameBody->authStatusCode);
|
||||
(uint32_t)rx_auth_frame->authStatusCode);
|
||||
if (STATUS_AP_UNABLE_TO_HANDLE_NEW_STA ==
|
||||
pRxAuthFrameBody->authStatusCode)
|
||||
rx_auth_frame->authStatusCode)
|
||||
ret_status = QDF_STATUS_E_NOSPC;
|
||||
} else {
|
||||
ret_status = QDF_STATUS_SUCCESS;
|
||||
|
|
@ -1851,12 +1858,14 @@ QDF_STATUS lim_process_auth_frame_no_session(struct mac_context *mac, uint8_t *p
|
|||
|
||||
default:
|
||||
pe_warn("Seq. no incorrect expected 2 received %d",
|
||||
(uint32_t) pRxAuthFrameBody->authTransactionSeqNumber);
|
||||
(uint32_t)rx_auth_frame->authTransactionSeqNumber);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Send the Auth response to SME */
|
||||
lim_handle_ft_pre_auth_rsp(mac, ret_status, pBody, frameLen, pe_session);
|
||||
lim_handle_ft_pre_auth_rsp(mac, ret_status, pBody,
|
||||
frameLen, pe_session);
|
||||
qdf_mem_free(rx_auth_frame);
|
||||
|
||||
return ret_status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue