qcacld-3.0: Free the cached assoc request if a new assoc req rcvd

Driver caches the assoc request received from an SAE STA if it's
received before getting external auth(SAE) status from hostapd.
Station might retry the assoc frame(ex: if it doesn't get assoc
response within a specific interval) and the cached assoc request
is overwritten with new assoc request, but the cached assoc
request is not freed. Free the same to avoid memleaks.

Change-Id: I576f3b8b05d17afc66481419d1b5bdc0765c84aa
CRs-Fixed: 2535425
This commit is contained in:
Srinivas Dasari 2019-09-27 14:22:47 +05:30 • committed by nshrivas
commit fffa0b4131
2 changed files with 12 additions and 0 deletions

View file

@ -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,

View file

@ -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