Browse Source

qcacld-3.0: Fix issues about uninitialized variables

Fix issues that variables used without initialization.

Change-Id: I40d7054a719bf8a442d153beeb4c9aa38bcad373
CRs-Fixed: 2416837
Zhaoyang Liu 6 years ago
parent
commit
132becce7e

+ 10 - 8
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -343,7 +343,8 @@ uint8_t lim_check_rx_rsn_ie_match(struct mac_context *mac_ctx,
 				  bool *pmf_connection)
 {
 	tDot11fIERSN *rsn_ie;
-	uint8_t i, j, match, only_non_ht_cipher = 1;
+	bool match = false;
+	uint8_t i, j, only_non_ht_cipher = 1;
 #ifdef WLAN_FEATURE_11W
 	bool we_are_pmf_capable;
 	bool we_require_pmf;
@@ -370,7 +371,7 @@ uint8_t lim_check_rx_rsn_ie_match(struct mac_context *mac_ctx,
 		if (!qdf_mem_cmp(&rx_rsn_ie->akm_suite[0],
 				 &rsn_ie->akm_suite[i],
 				 sizeof(rsn_ie->akm_suite[i]))) {
-			match = 1;
+			match = true;
 			break;
 		}
 	if (!match) {
@@ -390,13 +391,13 @@ uint8_t lim_check_rx_rsn_ie_match(struct mac_context *mac_ctx,
 	 * For each Pairwise cipher suite check whether we support
 	 * received pairwise
 	 */
-	match = 0;
+	match = false;
 	for (i = 0; i < rx_rsn_ie->pwise_cipher_suite_count; i++) {
 		for (j = 0; j < rsn_ie->pwise_cipher_suite_count; j++) {
 			if (!qdf_mem_cmp(&rx_rsn_ie->pwise_cipher_suites[i],
 			    &rsn_ie->pwise_cipher_suites[j],
 			    sizeof(rsn_ie->pwise_cipher_suites[j]))) {
-				match = 1;
+				match = true;
 				break;
 			}
 		}
@@ -478,7 +479,8 @@ lim_check_rx_wpa_ie_match(struct mac_context *mac, tDot11fIEWPA *rx_wpaie,
 			  struct pe_session *session_entry, uint8_t sta_is_ht)
 {
 	tDot11fIEWPA *wpa_ie;
-	uint8_t i, j, match, only_non_ht_cipher = 1;
+	bool match = false;
+	uint8_t i, j, only_non_ht_cipher = 1;
 
 	/* WPA IE should be received from PE */
 	wpa_ie = &session_entry->gStartBssWPAIe;
@@ -494,7 +496,7 @@ lim_check_rx_wpa_ie_match(struct mac_context *mac, tDot11fIEWPA *rx_wpaie,
 		if (!qdf_mem_cmp(&rx_wpaie->auth_suites[0],
 				 &wpa_ie->auth_suites[i],
 				 sizeof(wpa_ie->auth_suites[i]))) {
-			match = 1;
+			match = true;
 			break;
 		}
 	if (!match) {
@@ -515,12 +517,12 @@ lim_check_rx_wpa_ie_match(struct mac_context *mac, tDot11fIEWPA *rx_wpaie,
 	 * For each Pairwise cipher suite check whether we support
 	 * received pairwise
 	 */
-	match = 0;
+	match = false;
 	for (i = 0; i < rx_wpaie->unicast_cipher_count; i++) {
 		for (j = 0; j < wpa_ie->unicast_cipher_count; j++) {
 			if (!qdf_mem_cmp(rx_wpaie->unicast_ciphers[i],
 					    wpa_ie->unicast_ciphers[j], 4)) {
-				match = 1;
+				match = true;
 				break;
 			}
 		}

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2978,7 +2978,7 @@ void __lim_process_sme_assoc_cnf_new(struct mac_context *mac_ctx, uint32_t msg_t
 
 	if (msg_buf == NULL) {
 		pe_err("msg_buf is NULL");
-		goto end;
+		return;
 	}
 
 	qdf_mem_copy(&assoc_cnf, msg_buf, sizeof(assoc_cnf));

+ 1 - 1
core/sap/src/sap_module.c

@@ -2588,7 +2588,7 @@ QDF_STATUS wlansap_update_owe_info(struct sap_context *sap_ctx,
 	struct owe_assoc_ind *owe_assoc_ind;
 	struct assoc_ind *assoc_ind = NULL;
 	qdf_list_node_t *node = NULL, *next_node = NULL;
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	if (!wlansap_validate_owe_ies(ie, ie_len)) {
 		QDF_TRACE_ERROR(QDF_MODULE_ID_SAP, "Invalid OWE IE");