summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven2018-08-23 23:27:38 +0200
committerKalle Valo2018-08-31 17:52:29 +0200
commit81c8eccc2404d06082025b773f1d90e8c861bc6a (patch)
treee503651ff397a327d1471d9749f76059128c4f28 /drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
parentrsi: improve kernel thread handling to fix kernel panic (diff)
downloadkernel-qcow2-linux-81c8eccc2404d06082025b773f1d90e8c861bc6a.tar.gz
kernel-qcow2-linux-81c8eccc2404d06082025b773f1d90e8c861bc6a.tar.xz
kernel-qcow2-linux-81c8eccc2404d06082025b773f1d90e8c861bc6a.zip
mt76: Fix comparisons with invalid hardware key index
With gcc 4.1.2: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c: In function ‘mt76x0_tx’: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c:169: warning: comparison is always true due to limited range of data type drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c: In function ‘mt76x2_tx’: drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35: warning: comparison is always true due to limited range of data type While assigning -1 to a u8 works fine, comparing with -1 does not work as expected. Fix this by comparing with 0xff, like is already done in some other places. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
index 36afb166fa3f..c0ca0df84ed8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
@@ -32,7 +32,7 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
msta = (struct mt76x2_sta *)control->sta->drv_priv;
wcid = &msta->wcid;
/* sw encrypted frames */
- if (!info->control.hw_key && wcid->hw_key_idx != -1)
+ if (!info->control.hw_key && wcid->hw_key_idx != 0xff)
control->sta = NULL;
}