dev->wcid[] holds the group wcid of each vif at MT_VIF_WCID(). mt76x02_rx_get_sta() refused such an index until commit dc66a129adf1 ("wifi: mt76: add a wrapper for wcid access with validation") replaced its bound with the size of the table. It now takes the group wcid as a struct mt76x02_sta. For a group addressed frame whose RXWI names that wcid, mt76x02_rx_get_sta_wcid() derives a pointer from the vif index that follows the wcid, and mt76_check_sta() dereferences it. Whether the hardware reports that index is not known. Find no station for a wcid without one. Fixes: dc66a129adf1 ("wifi: mt76: add a wrapper for wcid access with validation") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x02.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02.h b/drivers/net/wireless/mediatek/mt76/mt76x02.h index f5a25608f8ff..da35daeb977a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x02.h @@ -265,7 +265,7 @@ mt76x02_rx_get_sta(struct mt76_dev *dev, u8 idx) struct mt76_wcid *wcid; wcid = __mt76_wcid_ptr(dev, idx); - if (!wcid) + if (!wcid || !wcid->sta) return NULL; return container_of(wcid, struct mt76x02_sta, wcid); -- 2.47.3