From fb7e0501b8f920b22811f1900255a5646abf18b8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 17 Aug 2025 20:24:24 +0200 Subject: [PATCH] wifi: mt76: mt7996: add missing check for rx wcid entries Non-station wcid entries must not be passed to the rx functions. In case of the global wcid entry, it could even lead to corruption in the wcid array due to pointer being casted to struct mt7996_sta_link using container_of. Fixes: 7464b12b7d92 ("wifi: mt76: mt7996: rework mt7996_rx_get_wcid to support MLO") Signed-off-by: Felix Fietkau --- mt7996/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mt7996/mac.c b/mt7996/mac.c index 837deb41..b3fcca9b 100644 --- a/mt7996/mac.c +++ b/mt7996/mac.c @@ -62,7 +62,7 @@ static struct mt76_wcid *mt7996_rx_get_wcid(struct mt7996_dev *dev, int i; wcid = mt76_wcid_ptr(dev, idx); - if (!wcid) + if (!wcid || !wcid->sta) return NULL; if (!mt7996_band_valid(dev, band_idx))