Skip to content

Commit

Permalink
mt7603: main: fix possible NULL pointer dereferencing in mt7603_ampdu…
Browse files Browse the repository at this point in the history
…_action()

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

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Dec 15, 2017
1 parent 00f7e60 commit 31e9bdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mt7603_main.c
Expand Up @@ -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);
Expand Down

0 comments on commit 31e9bdb

Please sign in to comment.