From 391e1488f88508c2a534d39cd6efd5cd671491bd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 10 Oct 2019 21:59:46 +0200 Subject: [PATCH] mt76: add sanity check for a-mpdu rx wcid index Avoid dereferencing invalid ids Signed-off-by: Felix Fietkau --- mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;