Browse Source

qcacld-3.0: Check radio id for FW event

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

Change-Id: Iadf61fbde53f80f1081da9a386cf13f0cce69e3c
CRs-Fixed: 2123782
Paul Zhang 7 years ago
parent
commit
05af1f6352
1 changed files with 7 additions and 0 deletions
  1. 7 0
      core/wma/src/wma_utils.c

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

@@ -1634,6 +1634,13 @@ static int wma_unified_link_radio_stats_event_handler(void *handle,
 	}
 	link_stats_results = wma_handle->link_stats_results;
 
+	if (radio_stats->radio_id >= link_stats_results->num_radio) {
+		WMA_LOGE("%s, invalid radio id:%d, num radio:%d",
+			__func__, radio_stats->radio_id,
+			link_stats_results->num_radio);
+		return -EINVAL;
+	}
+
 	WMA_LOGD("Radio stats Fixed Param:");
 	WMA_LOGD("req_id: %u num_radio: %u more_radio_events: %u",
 		 fixed_param->request_id, fixed_param->num_radio,