Ver código fonte

qcacld-3.0: Check radio id for FW event

In Rome platform, it use invalid radio id in FW event
WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID and cause crash. So check
radio id when handling this event.

Change-Id: Id720ca94ef496ea883f5ba1848fb4e28af57002f
CRs-Fixed: 2112322
Wu Gao 7 anos atrás
pai
commit
478282a8d0
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      core/wma/src/wma_utils.c

+ 7 - 0
core/wma/src/wma_utils.c

@@ -1377,6 +1377,13 @@ static int wma_unified_radio_tx_power_level_stats_event_handler(void *handle,
 		return -EINVAL;
 	}
 
+	if (fixed_param->radio_id >= link_stats_results->num_radio) {
+		WMA_LOGE("%s, invalid radio id:%d, num radio:%d",
+			__func__, fixed_param->radio_id,
+			link_stats_results->num_radio);
+		return -EINVAL;
+	}
+
 	WMA_LOGD("%s: tot_num_tx_pwr_lvls: %u num_tx_pwr_lvls: %u pwr_lvl_offset: %u radio_id: %u",
 			__func__, fixed_param->total_num_tx_power_levels,
 			 fixed_param->num_tx_power_levels,