Browse Source

qcacld-3.0: Fix some kw warnings

In function hdd_process_genie(), pointers like encrypt_type
and mc_encrypt_type should be validated before getting
dereferenced.

Add pointer validation before every dereferencing takes place.

Change-Id: Ib894153ddac3e75fae5e0e7798b705ac5951ea17
CRs-Fixed: 2775378
wadesong 4 years ago
parent
commit
fae1b8966e
1 changed files with 8 additions and 4 deletions
  1. 8 4
      core/hdd/src/wlan_hdd_assoc.c

+ 8 - 4
core/hdd/src/wlan_hdd_assoc.c

@@ -4946,11 +4946,13 @@ static int32_t hdd_process_genie(struct hdd_adapter *adapter,
 			hdd_translate_rsn_to_csr_auth_type(
 					dot11_rsn_ie.akm_suite[0]);
 		/* dot11_rsn_ie.pwise_cipher_suite_count */
-		*encrypt_type =
+		if (encrypt_type)
+			*encrypt_type =
 			hdd_translate_rsn_to_csr_encryption_type(
 					dot11_rsn_ie.pwise_cipher_suites[0]);
 		/* dot11_rsn_ie.gp_cipher_suite_count */
-		*mc_encrypt_type =
+		if (mc_encrypt_type)
+			*mc_encrypt_type =
 			hdd_translate_rsn_to_csr_encryption_type(
 					dot11_rsn_ie.gp_cipher_suite);
 #ifdef WLAN_FEATURE_11W
@@ -4989,11 +4991,13 @@ static int32_t hdd_process_genie(struct hdd_adapter *adapter,
 			hdd_translate_wpa_to_csr_auth_type(
 					dot11_wpa_ie.auth_suites[0]);
 		/* dot11_wpa_ie.unicast_cipher_count */
-		*encrypt_type =
+		if (encrypt_type)
+			*encrypt_type =
 			hdd_translate_wpa_to_csr_encryption_type(
 					dot11_wpa_ie.unicast_ciphers[0]);
 		/* dot11_wpa_ie.unicast_cipher_count */
-		*mc_encrypt_type =
+		if (mc_encrypt_type)
+			*mc_encrypt_type =
 			hdd_translate_wpa_to_csr_encryption_type(
 					dot11_wpa_ie.multicast_cipher);
 	} else {