diff options
| author | gaurank kathpalia <gkathpal@codeaurora.org> | 2017-09-28 16:41:57 +0530 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-11-20 10:28:05 -0800 |
| commit | ed8a99b2c85e078262389533fddeccb664a40fab (patch) | |
| tree | 3f50aa7685a31e673509e0986855ff2f40009101 | |
| parent | 7c146fd210c87edc269e28685af49006acf90f11 (diff) | |
qcacld-2.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: 2132226
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 1cc273552868..4565e4daaa54 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -7457,6 +7457,12 @@ static int wma_p2p_noa_event_handler(void *handle, u_int8_t *event, u_int32_t le descriptors = WMI_UNIFIED_NOA_ATTR_NUM_DESC_GET(p2p_noa_info); noa_ie.num_descriptors = (u_int8_t)descriptors; + 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_LOGI("%s: index %u, oppPs %u, ctwindow %u, " "num_descriptors = %u", __func__, noa_ie.index, noa_ie.oppPS, noa_ie.ctwindow, noa_ie.num_descriptors); |
