diff --git a/mac80211.c b/mac80211.c index a962abce..686d9b97 100644 --- a/mac80211.c +++ b/mac80211.c @@ -641,7 +641,7 @@ mt76_airtime_flush_ampdu(struct mt76_dev *dev) return; wcid_idx = dev->rx_ampdu_status.wcid_idx; - if (dev->rx_ampdu_status.wcid_idx != 0xff) + if (wcid_idx < ARRAY_SIZE(dev->wcid)) wcid = rcu_dereference(dev->wcid[wcid_idx]); else wcid = NULL;