From def4e79bc382f5250aeb70ea3f5d14e57d293529 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Wed, 15 Nov 2017 09:58:31 -0800 Subject: [PATCH] qcacld-3.0: Change local variables to dynamic in lim_process_auth_frame Propagation from qcacld-2.0 to qcacld-3.0. Change local variables to dynamic in lim_process_auth_frame as stack frame over 1024 bytes may cause build failure in 32 bit platforms. Change-Id: I83cf5ab24693e0ce012894d808ac79bf37fa9a08 CRs-Fixed: 2147286 --- core/mac/src/pe/lim/lim_process_auth_frame.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c index a1bfa1f1d1d3..0087c6ca7861 100644 --- a/core/mac/src/pe/lim/lim_process_auth_frame.c +++ b/core/mac/src/pe/lim/lim_process_auth_frame.c @@ -1060,7 +1060,7 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, { uint8_t *body_ptr, key_id, cfg_privacy_opt_imp; uint8_t defaultkey[SIR_MAC_KEY_LENGTH]; - uint8_t plainbody[LIM_ENCR_AUTH_BODY_LEN]; + uint8_t *plainbody = NULL; uint8_t decrypt_result; uint16_t frame_len, curr_seq_num = 0; uint32_t val, key_length = 8; @@ -1127,6 +1127,13 @@ lim_process_auth_frame(tpAniSirGlobal mac_ctx, uint8_t *rx_pkt_info, goto free; } + plainbody = qdf_mem_malloc(LIM_ENCR_AUTH_BODY_LEN); + if (!plainbody) { + pe_err("failed to allocate memory for plainbody"); + goto free; + } + qdf_mem_zero(plainbody, LIM_ENCR_AUTH_BODY_LEN); + /* * Determine if WEP bit is set in the FC or received MAC header * Note: WEP bit is set in FC of MAC header. @@ -1403,6 +1410,8 @@ free: qdf_mem_free(auth_frame); if (rx_auth_frame) qdf_mem_free(rx_auth_frame); + if (plainbody) + qdf_mem_free(plainbody); } /*----------------------------------------------------------------------