]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtw88: pci: check if queue mapping exceeds size of ac_to_hwq
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Fri, 3 May 2019 11:53:33 +0000 (19:53 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 28 May 2019 11:50:45 +0000 (14:50 +0300)
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>
drivers/net/wireless/realtek/rtw88/pci.c

index 87bfcb3504d5cc74b0c693712e9d5e9eb3fc5e0b..353871c27779847974db2e61438c4aa56fa6358f 100644 (file)
@@ -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];