summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorService qcabuildsw <qcabuildsw@localhost>2016-07-26 11:30:51 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-07-26 11:30:51 -0700
commite85276fd751375876d92539586d22aaa5a081c15 (patch)
treeb03c6f9cde3ba806fae85325c5215a2b255263b3
parent980d5423e6a2aed9d1f2b342a2b0f4d84398f464 (diff)
parente54e2ae2472b6d4f4251b01f8b3fe6a0626df553 (diff)
Merge "qcacld-3.0: Prevent overread of UP to AC mapping table" into wlan-cld3.driver.lnx.1.1-dev
-rw-r--r--core/hdd/src/wlan_hdd_wmm.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c
index 7ecbb79b0995..72ce6f77111c 100644
--- a/core/hdd/src/wlan_hdd_wmm.c
+++ b/core/hdd/src/wlan_hdd_wmm.c
@@ -1643,6 +1643,19 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter,
return;
}
+/**
+ * __hdd_get_queue_index() - get queue index
+ * @up: user priority
+ *
+ * Return: queue_index
+ */
+static uint16_t __hdd_get_queue_index(uint16_t up)
+{
+ if (qdf_unlikely(up >= ARRAY_SIZE(hdd_linux_up_to_ac_map)))
+ return HDD_LINUX_AC_BE;
+ return hdd_linux_up_to_ac_map[up];
+}
+
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
/**
* hdd_get_queue_index() - get queue index
@@ -1656,14 +1669,13 @@ uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol)
{
if (qdf_unlikely(is_eapol == true))
return HDD_LINUX_AC_HI_PRIO;
- else
- return hdd_linux_up_to_ac_map[up];
+ return __hdd_get_queue_index(up);
}
#else
static
uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol)
{
- return hdd_linux_up_to_ac_map[up];
+ return __hdd_get_queue_index(up);
}
#endif