qcacld-3.0: Check for upper bound in P2P NOA event

Check for the upper bounds for number of NOA descriptors
received in the P2P NOA event.

Change-Id: Id7ecf064f2c25f378f76d795902713da8520507f
CRs-Fixed: 2113072
This commit is contained in:
Varun Reddy Yeturu 2017-09-26 15:08:49 -07:00 • committed by snandini
commit 74c87c915f

View file

@ -1524,7 +1524,12 @@ int wma_p2p_noa_event_handler(void *handle, uint8_t *event,
descriptors = WMI_UNIFIED_NOA_ATTR_NUM_DESC_GET(p2p_noa_info);
noa_ie.num_descriptors = (uint8_t) descriptors;
WMA_LOGI("%s: index %u, oppPs %u, ctwindow %u, num_descriptors = %u",
if (noa_ie.num_descriptors > WMA_MAX_NOA_DESCRIPTORS) {
WMA_LOGD("Sizing down the no of desc %d to max",
noa_ie.num_descriptors);
noa_ie.num_descriptors = WMA_MAX_NOA_DESCRIPTORS;
}
WMA_LOGD("%s: index %u, oppPs %u, ctwindow %u, num_desc = %u",
__func__, noa_ie.index,
noa_ie.oppPS, noa_ie.ctwindow, noa_ie.num_descriptors);
for (i = 0; i < noa_ie.num_descriptors; i++) {