Browse Source

qcacld-3.0: validate vdev id for APF enable command

The vdev id might be invalid when sending WMI_BPF_SET_VDEV_ENABLE_CMDID
to firmware, which will cause assert in firmware.
To fix this issue, validate vdev id before sending the command.

Change-Id: Ie1b60c5eeb6704de963f23d7fef0649c208081a4
CRs-Fixed: 3260462
Yu Wang 2 years ago
parent
commit
6814538c08
1 changed files with 3 additions and 0 deletions
  1. 3 0
      core/wma/src/wma_features.c

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

@@ -4152,6 +4152,9 @@ QDF_STATUS wma_send_apf_enable_cmd(WMA_HANDLE handle, uint8_t vdev_id,
 	tp_wma_handle wma = (tp_wma_handle) handle;
 	struct wmi_unified *wmi_handle;
 
+	if (!wma_is_vdev_valid(vdev_id))
+		return QDF_STATUS_E_INVAL;
+
 	if (wma_validate_handle(wma))
 		return QDF_STATUS_E_INVAL;