Explorar el Código

qcacld-3.0: Check if VDEV is valid before sending SET_IE to firmware

Check VDEV validity before sending WMI_VDEV_SET_IE_CMDID to firmware.

Change-Id: I3f6dfb69398df0c91097a3a0242343428c702029
CRs-Fixed: 1108037
Naveen Rawat hace 8 años
padre
commit
b47287a0ad
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      core/wma/src/wma_features.c

+ 12 - 0
core/wma/src/wma_features.c

@@ -7863,6 +7863,7 @@ int wma_fw_mem_dump_event_handler(void *handle, u_int8_t *cmd_param_info,
 QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
 				   struct vdev_ie_info *ie_info)
 {
+	struct wma_txrx_node *interface;
 	struct vdev_ie_info_param cmd = {0};
 	int ret;
 
@@ -7877,6 +7878,17 @@ QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma,
 		return QDF_STATUS_E_INVAL;
 	}
 
+	if (ie_info->vdev_id >= wma->max_bssid) {
+		WMA_LOGE(FL("Invalid vdev_id: %d"), ie_info->vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	interface = &wma->interfaces[ie_info->vdev_id];
+	if (!interface->is_vdev_valid) {
+		WMA_LOGE(FL("vdev_id: %d is not active"), ie_info->vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
 	cmd.vdev_id = ie_info->vdev_id;
 	cmd.ie_id = ie_info->ie_id;
 	cmd.length = ie_info->length;