mac80211: fix issue with possible txq NULL pointer
authorErik Stromdahl <erik.stromdahl@gmail.com>
Fri, 14 Sep 2018 16:00:34 +0000 (18:00 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 2 Oct 2018 07:56:29 +0000 (09:56 +0200)
Drivers that do not have the BUFF_MMPDU_TXQ flag set will not have a
TXQ for the special TID = 16.

In this case, the last member in the *struct ieee80211_sta* txq array
will be NULL.

We must check this in order not to get a NULL pointer dereference when
iterating the txq array.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/util.c

index 36a3c2ada5154a6a4c35d4f71b528811b85836c2..ef5d1f60a63b50dc0a009133bfb23cb864f7d2f8 100644 (file)
@@ -264,6 +264,9 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac)
                for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
                        struct ieee80211_txq *txq = sta->sta.txq[i];
 
+                       if (!txq)
+                               continue;
+
                        txqi = to_txq_info(txq);
 
                        if (ac != txq->ac)