qcacld-3.0: Add check for vdev_id in wma_rcpi_event_handler

Currently event->vdev_id, recevied from the FW, is directly used
to refer to wma->interfaces without validating if the vdev_id is valid.

Add sanity check to make sure vdev_id is less than max_bssid before
using it.

Change-Id: I9fd97e430532c597a6c4b4e42b5dfaddba628ffb
CRs-Fixed: 2119442
This commit is contained in:
Vignesh Viswanathan 2018-11-19 17:20:35 +05:30 committed by Nitesh Shrivastav
parent eeddb38065
commit 4bb899c357

View File

@ -4486,6 +4486,12 @@ int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info,
if (status == QDF_STATUS_E_INVAL)
return -EINVAL;
if (res.vdev_id >= wma_handle->max_bssid) {
WMA_LOGE("%s: received invalid vdev_id %d",
__func__, res.vdev_id);
return -EINVAL;
}
iface = &wma_handle->interfaces[res.vdev_id];
if (!iface->rcpi_req) {
WMI_LOGE("rcpi_req buffer not available");