Browse Source

qcacld-3.0: Check number of dbs hw modes

In WMI_SERVICE_READY_EVENTID, check for number of dbs HW modes against
the metadata.

Change-Id: I043c93c4e6bc0dfdd73dbdc65bab683c56269308
CRs-Fixed: 2119387
Amar Singhal 7 years ago
parent
commit
7b038cad15
1 changed files with 7 additions and 0 deletions
  1. 7 0
      core/wma/src/wma_main.c

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

@@ -4966,6 +4966,13 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 
 	WMA_LOGD("WMA <-- WMI_SERVICE_READY_EVENTID");
 
+	if (ev->num_dbs_hw_modes > param_buf->num_wlan_dbs_hw_mode_list) {
+		WMA_LOGE("FW dbs_hw_mode entry %d more than value %d in TLV hdr",
+			 ev->num_dbs_hw_modes,
+			 param_buf->num_wlan_dbs_hw_mode_list);
+		return -EINVAL;
+	}
+
 	wma_handle->num_dbs_hw_modes = ev->num_dbs_hw_modes;
 	ev_wlan_dbs_hw_mode_list = param_buf->wlan_dbs_hw_mode_list;
 	wma_handle->hw_mode.hw_mode_list =