Przeglądaj źródła

qcacmn: Fix uninitialized var ptr issue and null check for num_pscos

1.This change fixes the use of uninitialized
variable in host driver.

2.Adds NULL check for num_psocs in mlo_peer_calculate_avg_rssi to
avoid undefined behaviour.

Change-Id: Ifbfef42b5930dfe15736a75a74e81155c5f1fbce
CRs-Fixed: 3297794
Asutosh Mohapatra 2 lat temu
rodzic
commit
9ab40cb89e

+ 1 - 1
target_if/spectral/target_if_spectral_phyerr.c

@@ -4043,7 +4043,7 @@ int target_if_spectral_process_report_gen3(
 	int ret = 0;
 	struct direct_buf_rx_data *payload = buf;
 	struct target_if_spectral *spectral;
-	struct spectral_report report;
+	struct spectral_report report = {0};
 	int samp_msg_index;
 	struct spectral_data_stats *spectral_dp_stats;
 

+ 3 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_primary_umac.c

@@ -361,6 +361,9 @@ static void mlo_peer_calculate_avg_rssi(
 								 rssi);
 	}
 
+	if (!num_psocs)
+		return;
+
 	ml_peer->avg_link_rssi = total_rssi / num_psocs;
 }