Răsfoiți Sursa

qcacmn: Initialize the chan_params structure

chan_params structure is uninitialized, due to which variables
inside the chan_params structure have garbage values.
To avoid this, initialize the chan_params structure.

Change-Id: Ic09c0a2d24c2a1eac8f076c7bbd4d25d147370fd
CRs-Fixed: 3205502
Divya R 3 ani în urmă
părinte
comite
33e3e1d6a8

+ 1 - 1
target_if/spectral/target_if_spectral.c

@@ -4289,7 +4289,7 @@ static bool
 target_if_spectral_is_valid_80p80_freq(struct wlan_objmgr_pdev *pdev,
 				       uint32_t cfreq1, uint32_t cfreq2)
 {
-	struct ch_params ch_params;
+	struct ch_params ch_params = {0};
 	enum channel_state chan_state1;
 	enum channel_state chan_state2;
 	struct wlan_objmgr_psoc *psoc;

+ 3 - 3
umac/regulatory/core/src/reg_opclass.c

@@ -1224,7 +1224,7 @@ void reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
 	enum channel_enum chan_enum;
 	struct regulatory_channel *cur_chan_list;
 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
-	struct ch_params chan_params;
+	struct ch_params chan_params = {0};
 
 	pdev_priv_obj = reg_get_pdev_obj(pdev);
 
@@ -1563,7 +1563,7 @@ static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
 {
 	struct reg_channel_list chan_list;
 	qdf_freq_t center_320;
-	struct ch_params ch_params;
+	struct ch_params ch_params = {0};
 
 	center_320 = (ch_width == CH_WIDTH_320MHZ) ? cfi_freq : 0;
 	reg_fill_channel_list(pdev,
@@ -1585,7 +1585,7 @@ static bool reg_is_chan_supported(struct wlan_objmgr_pdev *pdev,
 				  qdf_freq_t cfi_freq,
 				  enum phy_ch_width ch_width)
 {
-	struct ch_params ch_params;
+	struct ch_params ch_params = {0};
 
 	ch_params.ch_width = ch_width;
 	reg_set_channel_params_for_freq(pdev, pri_freq, 0, &ch_params, true);