Эх сурвалжийг харах

qcacld-3.0: Fix uninitialized var and dereference of freed ptr issue

This change fixes the use of uninitialized variable and dereference of
free pointer issue in host driver.

Change-Id: I88359cd383d15f9baa73bc7c3ce9d5fccee2a41e
CRs-Fixed: 3295234
Rahul Gusain 2 жил өмнө
parent
commit
6e0ecd3d99

+ 1 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -285,6 +285,7 @@ mlme_peer_object_created_notification(struct wlan_objmgr_peer *peer,
 	if (QDF_IS_STATUS_ERROR(status)) {
 		mlme_legacy_err("unable to attach peer_priv obj to peer obj");
 		qdf_mem_free(peer_priv);
+		return status;
 	}
 
 	qdf_wake_lock_create(&peer_priv->peer_set_key_wakelock, "peer_set_key");

+ 1 - 3
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -1869,7 +1869,7 @@ QDF_STATUS lim_populate_matching_rate_set(struct mac_context *mac_ctx,
 					  tDot11fIEeht_cap *eht_caps)
 {
 	tSirMacRateSet temp_rate_set;
-	tSirMacRateSet temp_rate_set2;
+	tSirMacRateSet temp_rate_set2 = {0};
 	uint32_t i, j, val, min, is_arate;
 	uint32_t phy_mode;
 	uint8_t mcs_set[SIZE_OF_SUPPORTED_MCS_SET];
@@ -1893,8 +1893,6 @@ QDF_STATUS lim_populate_matching_rate_set(struct mac_context *mac_ctx,
 			     session_entry->extRateSet.numRates);
 		temp_rate_set2.numRates =
 			(uint8_t) session_entry->extRateSet.numRates;
-	} else {
-		temp_rate_set2.numRates = 0;
 	}
 
 	lim_remove_membership_selectors(&temp_rate_set);