summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw88/pci.c
diff options
context:
space:
mode:
authorYan-Hsuan Chuang <yhchuang@realtek.com>2019-05-03 19:53:33 +0800
committerKalle Valo <kvalo@codeaurora.org>2019-05-28 14:50:45 +0300
commit0d7882950c73de464c3d95ae5e4038059dcd46c8 (patch)
treebad969e38a593103da4d3201a5c9a4c99e609c8f /drivers/net/wireless/realtek/rtw88/pci.c
parent82dea406c50946b9653dd80ec6f39a8d6f43ed89 (diff)
rtw88: pci: check if queue mapping exceeds size of ac_to_hwq
Dump warning messages when we get a q_mapping larger than the AC numbers. And pick BE queue as default. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/pci.c')
-rw-r--r--drivers/net/wireless/realtek/rtw88/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 87bfcb3504d5..353871c27779 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -504,6 +504,8 @@ static u8 rtw_hw_queue_mapping(struct sk_buff *skb)
queue = RTW_TX_QUEUE_BCN;
else if (unlikely(ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc)))
queue = RTW_TX_QUEUE_MGMT;
+ else if (WARN_ON_ONCE(q_mapping >= ARRAY_SIZE(ac_to_hwq)))
+ queue = ac_to_hwq[IEEE80211_AC_BE];
else
queue = ac_to_hwq[q_mapping];