Sfoglia il codice sorgente

qcacld-3.0: Change center_freq_diff from int8 to int32 to avoid overflow

center_freq_diff may overflow int8 when channel width is 320 MHz.
Also clear acs_ch_params before pass it to regulatory API to avoid set
mhz_freq_seg1 which is uninitialized value.

Change-Id: I497ae02c7b53458537e706f2231c0ffef2439961
CRs-Fixed: 3371957
Will Huang 2 anni fa
parent
commit
1556ac57f3
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      core/sap/src/sap_ch_select.c

+ 3 - 2
core/sap/src/sap_ch_select.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1999,7 +1999,7 @@ sap_sort_chl_weight_320_mhz(struct mac_context *mac_ctx,
 	tSapSpectChInfo *pSpectInfo;
 	uint8_t minIdx;
 	struct ch_params acs_ch_params;
-	int8_t center_freq_diff;
+	int32_t center_freq_diff;
 	uint32_t combined_weight;
 	uint32_t min_ch_weight;
 	uint32_t valid_chans = 0;
@@ -2010,6 +2010,7 @@ sap_sort_chl_weight_320_mhz(struct mac_context *mac_ctx,
 		if (pSpectInfo[j].weight_calc_done)
 			continue;
 
+		qdf_mem_zero(&acs_ch_params, sizeof(acs_ch_params));
 		acs_ch_params.ch_width = CH_WIDTH_320MHZ;
 		sap_acs_set_puncture_support(sap_ctx, &acs_ch_params);