From: Erik Stromdahl Date: Mon, 18 Jun 2018 14:01:21 +0000 (+0300) Subject: ath10k: fix bug in masking of TID value X-Git-Tag: v5.15~8230^2~121^2~70^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1a566bec5887988cd7e4b7cf98b05e1ff7a0f8a;p=platform%2Fkernel%2Flinux-starfive.git ath10k: fix bug in masking of TID value Although the TID mask is 0xf, the modulus operation does still not produce identical results as the bitwise and operator. If the TID is 15, the modulus operation will "convert" it to 0, whereas the bitwise and will keep it as 15. This was found during code review. Signed-off-by: Erik Stromdahl Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 89157c5..be5b52a 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1056,7 +1056,7 @@ static u8 ath10k_htt_tx_get_tid(struct sk_buff *skb, bool is_eth) if (!is_eth && ieee80211_is_mgmt(hdr->frame_control)) return HTT_DATA_TX_EXT_TID_MGMT; else if (cb->flags & ATH10K_SKB_F_QOS) - return skb->priority % IEEE80211_QOS_CTL_TID_MASK; + return skb->priority & IEEE80211_QOS_CTL_TID_MASK; else return HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST; }