qcacld-3.0: Validate bssDescription before using it

Validate bssDescription before dereferencing it.

Change-Id: I89f8c07ad2e38e59dd2a002ce95cfac88232ccc9
CRs-Fixed: 2729263
Tento commit je obsažen v:
Gururaj Pandurangi
2020-07-10 13:05:38 -07:00
odevzdal nshrivas
rodič 0412d9a24f
revize 77ba18197c

Zobrazit soubor

@@ -1628,8 +1628,7 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
uint8_t aRateIndex = 0;
uint8_t bRateIndex = 0;
tDot11fIEhe_cap *peer_he_caps;
struct bss_description *bssDescription =
&pe_session->lim_join_req->bssDescription;
struct bss_description *bssDescription;
tSchBeaconStruct *pBeaconStruct = NULL;
/* copy operational rate set from pe_session */
@@ -1758,6 +1757,10 @@ QDF_STATUS lim_populate_peer_rate_set(struct mac_context *mac,
peer_he_caps = he_caps;
} else {
bssDescription = &pe_session->lim_join_req->bssDescription;
if (!bssDescription) {
pe_err("bssDescription is NULL");
return QDF_STATUS_E_INVAL;
}
pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
if (!pBeaconStruct)
return QDF_STATUS_E_NOMEM;