diff options
author | Abhinav Kumar <abhikuma@codeaurora.org> | 2018-07-10 18:06:56 +0800 |
---|---|---|
committer | Shirle Yuen <shirleyshukyee@google.com> | 2018-07-30 10:32:54 -0700 |
commit | f4b4833cb7c920ce7e9aa732c930eebae97fed50 (patch) | |
tree | 2412509459775dc0f479ee9c7210117d4bbc1a96 | |
parent | 9761f52276bde5285b80e332ff1b1de50e6c4af3 (diff) | |
download | qcom-msm8x09-v3.10-f4b4833cb7c920ce7e9aa732c930eebae97fed50.tar.gz |
qcacld-2.0: Fix check for num_ac in iface stats event handler
In function wma_unified_link_iface_stats_event_handler, num_ac
is received from the firmware and is used in the loop to populate
values into result. However the memory for result is allocated
for WIFI_AC_MAX (which is 4). While copying the data from fw, the
fw loop is looped from i = 0 to i < num_ac which is 0 to 3.
So the value of num_ac = 4 from the fw is not an issue.
Modify the upper limit check for num_ac to be greater than
WIFI_AC_MAX instead of greater than equal to WIFI_AC_MAX.
Change-Id: Iefb71563e4608e6fe3ab300bf7a9a96f748c7853
CRs-Fixed: 2197481
Bug: 111289931
(cherry picked from commit 0cb918b794952b5d58d20f18735b219ddc5abe0b)
-rw-r--r-- | drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c index db7c8fe3c86..0fb91488c75 100644 --- a/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c +++ b/drivers/staging/qcacld-2.0/CORE/SERVICES/WMA/wma.c @@ -4983,7 +4983,7 @@ static int wma_unified_link_iface_stats_event_handler(void *handle, WMA_LOGA("%s: Invalid param_tlvs for Iface Stats", __func__); return -EINVAL; } - if (link_stats->num_ac >= WIFI_AC_MAX) { + if (link_stats->num_ac > WIFI_AC_MAX) { WMA_LOGE("%s: Excess data received from firmware num_ac %d", __func__, link_stats->num_ac); return -EINVAL; |