Parcourir la source

qcacmn: Fix uninitialize variables in few policy manager APIs

Few variables are left uninitialized and they are being used
with some random value.

Fix by initializing to default value.

CRs-Fixed: 2232791
Change-Id: I3351cae52c58e963601d53376f42ca8ebf0d3b9a
Krunal Soni il y a 7 ans
Parent
commit
3370ea52d1

+ 1 - 1
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -1357,7 +1357,7 @@ policy_mgr_get_nondfs_preferred_channel(struct wlan_objmgr_psoc *psoc,
 	 * under 5G MCC scenario
 	 */
 	uint8_t channel = PM_24_GHZ_CHANNEL_6;
-	uint32_t i, pcl_len;
+	uint32_t i, pcl_len = 0;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {

+ 2 - 2
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -536,8 +536,8 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
 static void utils_dfs_get_chan_list(struct wlan_objmgr_pdev *pdev,
 	struct dfs_channel *chan_list, uint32_t *num_chan)
 {
-	uint8_t pcl_ch[NUM_CHANNELS];
-	uint8_t weight_list[NUM_CHANNELS];
+	uint8_t pcl_ch[NUM_CHANNELS] = {0};
+	uint8_t weight_list[NUM_CHANNELS] = {0};
 	uint32_t len;
 	uint32_t weight_len;
 	int i;