diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 89a0f88c6c..5bd9782b87 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -5544,6 +5544,11 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, __func__, wmi_event->reason, wmi_event->notif, wmi_event->vdev_id, wmi_event->rssi); + if (wmi_event->vdev_id >= wma_handle->max_bssid) { + WMA_LOGE("Invalid vdev id from firmware"); + return -EINVAL; + } + DPTRACE(qdf_dp_trace_record_event(QDF_DP_TRACE_EVENT_RECORD, wmi_event->vdev_id, QDF_TRACE_DEFAULT_PDEV_ID, QDF_PROTO_TYPE_EVENT, QDF_ROAM_EVENTID));