diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 37725ad1f5a6..4cb42faf0db1 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -1871,7 +1871,7 @@ static void lim_process_periodic_join_probe_req_timer(struct mac_context *mac_ct static void lim_process_auth_retry_timer(struct mac_context *mac_ctx) { struct pe_session *session_entry; - tAniAuthType auth_type = mac_ctx->lim.gpLimMlmAuthReq->authType; + tAniAuthType auth_type; tLimTimers *lim_timers = &mac_ctx->lim.lim_timers; uint16_t vdev_id = lim_timers->g_lim_periodic_auth_retry_timer.sessionId; @@ -1891,14 +1891,16 @@ static void lim_process_auth_retry_timer(struct mac_context *mac_ctx) * Send the auth retry only in case we have received ack failure * else just restart the retry timer. */ - if (LIM_AUTH_ACK_RCD_FAILURE == mac_ctx->auth_ack_status) { + if (LIM_AUTH_ACK_RCD_FAILURE == mac_ctx->auth_ack_status && + mac_ctx->lim.gpLimMlmAuthReq) { + auth_type = mac_ctx->lim.gpLimMlmAuthReq->authType; + /* Prepare & send Authentication frame */ if (session_entry->sae_pmk_cached && auth_type == eSIR_AUTH_TYPE_SAE) auth_frame.authAlgoNumber = eSIR_OPEN_SYSTEM; else - auth_frame.authAlgoNumber = (uint8_t) - mac_ctx->lim.gpLimMlmAuthReq->authType; + auth_frame.authAlgoNumber = (uint8_t)auth_type; auth_frame.authTransactionSeqNumber = SIR_MAC_AUTH_FRAME_1;