From 74c87c915f2a8d277587ec258e7d6327e40e0e91 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Tue, 26 Sep 2017 15:08:49 -0700 Subject: [PATCH] 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 --- core/wma/src/wma_power.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index 1b783ee42d6e..bd23e1bcf830 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -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++) {