qcacld-3.0: Avoid NULL pointer exception in (re)assoc event

In hdd_send_association_event() and hdd_send_re_assoc_event(), there is
no check of pBssDesc against NULL which can lead to NULL pointer exception.
Circumvent this issue by adding NULL check.

Change-Id: Ic3a0142b4ea3f058e8d3993fb491d418ddb8f70d
CRs-Fixed: 2232721
This commit is contained in:
Rajeev Kumar Sirasanagandla 2018-05-02 18:20:20 +05:30 • committed by nshrivas
commit e5582aa7ef

View file

@ -1327,7 +1327,7 @@ static void hdd_send_association_event(struct net_device *dev,
if (eConnectionState_Associated == sta_ctx->conn_info.connState) {
tSirSmeChanInfo chan_info = {0};
if (!pCsrRoamInfo) {
if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) {
hdd_warn("STA in associated state but pCsrRoamInfo is null");
return;
}
@ -2311,7 +2311,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev,
hdd_err("Unable to allocate Assoc Req IE");
goto done;
}
if (pCsrRoamInfo == NULL) {
if (!pCsrRoamInfo || !pCsrRoamInfo->pBssDesc) {
hdd_err("Invalid CSR roam info");
goto done;
}