From 05af1f63528813e3ec293ccebde381f3826e8c1b Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Tue, 10 Oct 2017 15:11:06 +0800 Subject: [PATCH] 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 --- core/wma/src/wma_utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 5cb5c319fb12..6722136f90ff 100644 --- a/core/wma/src/wma_utils.c +++ b/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,