Browse Source

qcacld-3.0: Avoid using pointer without NULL check

Fix static analyze issues which cause is may dereference NULL
pointer, adding NULL pointer check or using already checked pointer.

Change-Id: Ib3a1f5214da839cd2bec4ffee16e0809095fa513
CRs-Fixed: 2058073
Will Huang 7 years ago
parent
commit
03b54ee905
2 changed files with 4 additions and 5 deletions
  1. 2 1
      core/hdd/src/wlan_hdd_assoc.c
  2. 2 4
      core/sme/src/csr/csr_api_roam.c

+ 2 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -2718,7 +2718,8 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 				}
 
 				if (ft_carrier_on) {
-					if (!hddDisconInProgress) {
+					if (!hddDisconInProgress &&
+						pRoamInfo->pBssDesc) {
 						struct cfg80211_bss *roam_bss;
 
 						/*

+ 2 - 4
core/sme/src/csr/csr_api_roam.c

@@ -9190,8 +9190,7 @@ csr_roaming_state_config_cnf_processor(tpAniSirGlobal mac_ctx,
 		    && csr_roam_is11r_assoc(mac_ctx, session_id)) {
 			status = csr_roam_issue_reassociate(mac_ctx,
 					session_id, bss_desc,
-					(tDot11fBeaconIEs *)
-					(scan_result->Result.pvIes),
+					local_ies,
 					&cmd->u.roamCmd.roamProfile);
 		} else
 #ifdef FEATURE_WLAN_ESE
@@ -9214,8 +9213,7 @@ csr_roaming_state_config_cnf_processor(tpAniSirGlobal mac_ctx,
 			 */
 			status = csr_roam_issue_join(mac_ctx, session_id,
 						    bss_desc,
-						    (tDot11fBeaconIEs *)
-						    (scan_result->Result.pvIes),
+						    local_ies,
 						    &cmd->u.roamCmd.roamProfile,
 						    cmd->u.roamCmd.roamId);
 		}