Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0c1613c authored by CNSS_WLAN Service's avatar CNSS_WLAN Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "prima: Protect pHashTable with lock" into wlan-driver.lnx.1.0

parents e3424f16 b2ff85c0
Loading
Loading
Loading
Loading
+28 −8
Original line number Diff line number Diff line
@@ -2469,6 +2469,8 @@ bool lim_is_assoc_req_for_drop(tpAniSirGlobal pMac, uint8_t *rx_pkt_info)
    tpPESession session_entry;
    tpSirMacMgmtHdr pMacHdr;
    tpDphHashNode sta_ds;
    bool status;
    eHalStatus lock_status = eHAL_STATUS_SUCCESS;

    pMacHdr = WDA_GET_RX_MAC_HEADER(rx_pkt_info);
    session_entry = peFindSessionByBssid(pMac, pMacHdr->bssId, &session_id);
@@ -2479,27 +2481,45 @@ bool lim_is_assoc_req_for_drop(tpAniSirGlobal pMac, uint8_t *rx_pkt_info)
       pMacHdr->sa););
       return false;
    }

    lock_status =  pe_AcquireGlobalLock(&pMac->lim);
    if (lock_status != eHAL_STATUS_SUCCESS)
    {
	    limLog(pMac, LOGE, FL("pe_AcquireGlobalLock error"));
	    return TRUE;
    }

    sta_ds = dphLookupHashEntry(pMac, pMacHdr->sa, &aid,
                       &session_entry->dph.dphHashTable);
    if (!sta_ds)
    {
       PELOG1(limLog(pMac, LOG1, FL("pStaDs is NULL")););
       return false;
       status = false;
       goto end;
    }

    if (!sta_ds->rmfEnabled)
       return false;
    if (!sta_ds->rmfEnabled) {
       status = false;
       goto end;
    }

    if (sta_ds->pmfSaQueryState == DPH_SA_QUERY_IN_PROGRESS)
       return true;
    if (sta_ds->pmfSaQueryState == DPH_SA_QUERY_IN_PROGRESS) {
       status = true;
       goto end;
    }

    if (sta_ds->last_assoc_received_time &&
       ((vos_timer_get_system_time() -
         sta_ds->last_assoc_received_time) < 1000))
       return true;
         sta_ds->last_assoc_received_time) < 1000)) {
	 status = true;
	 goto end;
    }

    sta_ds->last_assoc_received_time = vos_timer_get_system_time();
    return false;
    status = false;
end:
	pe_ReleaseGlobalLock(&pMac->lim);
	return status;
}
#endif