diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index 454c1916db5b..6a81d510056e 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -1968,8 +1968,19 @@ static void lim_defer_sme_indication(struct mac_context *mac_ctx, struct sDphHashNode *sta_ds) { struct tLimPreAuthNode *sta_pre_auth_ctx; + struct lim_assoc_data *cached_req; + /* Extract pre-auth context for the STA, if any. */ sta_pre_auth_ctx = lim_search_pre_auth_list(mac_ctx, hdr->sa); + if (sta_pre_auth_ctx->assoc_req.present) { + pe_debug("Free the cached assoc req as a new one is received"); + cached_req = &sta_pre_auth_ctx->assoc_req; + lim_process_assoc_cleanup(mac_ctx, session, + cached_req->assoc_req, + cached_req->sta_ds, + cached_req->assoc_req_copied); + } + sta_pre_auth_ctx->assoc_req.present = true; sta_pre_auth_ctx->assoc_req.sub_type = sub_type; qdf_mem_copy(&sta_pre_auth_ctx->assoc_req.hdr, hdr, diff --git a/core/mac/src/pe/lim/lim_security_utils.c b/core/mac/src/pe/lim/lim_security_utils.c index 4efb0891a1c6..2d3408cc8699 100644 --- a/core/mac/src/pe/lim/lim_security_utils.c +++ b/core/mac/src/pe/lim/lim_security_utils.c @@ -314,6 +314,7 @@ void lim_release_pre_auth_node(struct mac_context *mac, if (assoc->assocReqFrameLength) qdf_mem_free(assoc->assocReqFrame); qdf_mem_free(assoc); + pAuthNode->assoc_req.assoc_req = NULL; pAuthNode->assoc_req.present = false; } MTRACE(mac_trace