summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>2017-12-14 13:03:16 +0100
committerKalle Valo <kvalo@codeaurora.org>2018-01-17 16:49:06 +0200
commit99ac5327e902a56ca21365ed3d6e5249fe296ba6 (patch)
tree028077fd5355f25cb36b997cecdbb01b31265197 /drivers/net/wireless
parent70c8de0c154d6f40be75d12882756d126bbc4967 (diff)
downloadlinux-99ac5327e902a56ca21365ed3d6e5249fe296ba6.tar.gz
linux-99ac5327e902a56ca21365ed3d6e5249fe296ba6.tar.bz2
linux-99ac5327e902a56ca21365ed3d6e5249fe296ba6.zip
mt76: fix possible NULL pointer dereferencing in mt76x2_ampdu_action()
Initialize mt76_txq pointer after ieee80211_txq pointer check. Remove space after the pointer cast Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
index 963aea9e8801..79915cbee3f0 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
@@ -465,13 +465,15 @@ mt76x2_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct mt76x2_dev *dev = hw->priv;
struct mt76x2_sta *msta = (struct mt76x2_sta *) sta->drv_priv;
struct ieee80211_txq *txq = sta->txq[params->tid];
- struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;
u16 tid = params->tid;
u16 *ssn = &params->ssn;
+ struct mt76_txq *mtxq;
if (!txq)
return -EINVAL;
+ mtxq = (struct mt76_txq *)txq->drv_priv;
+
switch (action) {
case IEEE80211_AMPDU_RX_START:
mt76_set(dev, MT_WCID_ADDR(msta->wcid.idx) + 4, BIT(16 + tid));