mt76: add sanity check for a-mpdu rx wcid index

Avoid dereferencing invalid ids

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2019-10-10 21:59:46 +02:00
parent 237312c5e4
commit bf5238b25a

View File

@ -644,7 +644,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;