mt7603: main: fix possible NULL pointer dereferencing in mt7603_ampdu_action()

Initialize mt76_txq pointer after ieee80211_txq pointer check.
Remove space after the pointer cast

Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2018-01-30 10:23:03 +01:00
committed by Felix Fietkau
parent d225fa72b8
commit d543b03eac
+3 -1
View File
@@ -456,14 +456,16 @@ mt7603_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta = params->sta;
struct ieee80211_txq *txq = sta->txq[params->tid];
struct mt7603_sta *msta = (struct mt7603_sta *) sta->drv_priv;
struct mt76_txq *mtxq = (struct mt76_txq *) txq->drv_priv;
u16 tid = params->tid;
u16 *ssn = &params->ssn;
u8 ba_size = params->buf_size;
struct mt76_txq *mtxq;
if (!txq)
return -EINVAL;
mtxq = (struct mt76_txq *)txq->drv_priv;
switch (action) {
case IEEE80211_AMPDU_RX_START:
mt7603_mac_rx_ba_reset(dev, sta->addr, tid);