1: cd95ed396703 ! 1: 80a623b452b2 wifi: mt76: mt7925: fix mt7925_reverse_frag0_hdr_trans() for MLO @@ Commit message station through the sta back pointer of the link and wcid_to_sta(), and take the BSSID from the bss_conf of the receiving link.  + The unicast path of mt792x_rx_get_wcid() returns the WTBL entry + unchecked, and not every entry is a station link: index 0 holds the + bare global wcid. Check wcid->sta before converting the wcid to + struct mt792x_link_sta, as the non-unicast path already does. + Found by LLM-assisted source review. Not tested on hardware.  Fixes: 43aa4033eb18 ("wifi: mt76: mt7925: add mt7925_change_sta_links") @@ drivers/net/wireless/mediatek/mt76/mt7925/mac.c: static int mt7925_reverse_frag0 struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; struct ethhdr *eth_hdr = (struct ethhdr *)(skb->data + hdr_gap);  - struct mt792x_sta *msta = (struct mt792x_sta *)status->wcid; -+ struct mt792x_link_sta *mlink = (struct mt792x_link_sta *)status->wcid; -+ struct mt792x_sta *msta = mlink ? mlink->sta : NULL;  + struct ieee80211_bss_conf *link_conf; ++ struct mt792x_link_sta *mlink; __le32 *rxd = (__le32 *)skb->data; struct ieee80211_sta *sta; ++ struct mt792x_sta *msta; struct ieee80211_vif *vif; + struct ieee80211_hdr hdr; + u16 frame_control;  @@ drivers/net/wireless/mediatek/mt76/mt7925/mac.c: static int mt7925_reverse_frag0_hdr_trans(struct sk_buff *skb, u16 hdr_gap) + if (!(le32_to_cpu(rxd[1]) & MT_RXD1_NORMAL_GROUP_4)) + return -EINVAL; +  ++ /* not every WTBL entry is a station link, e.g. the global wcid */ ++ if (!status->wcid || !status->wcid->sta) ++ return -EINVAL; ++ ++ mlink = container_of(status->wcid, struct mt792x_link_sta, wcid); ++ msta = mlink->sta; if (!msta || !msta->vif) return -EINVAL;  @@ drivers/net/wireless/mediatek/mt76/mt7925/mac.c: static int mt7925_reverse_frag0  + sta = wcid_to_sta(status->wcid); vif = container_of((void *)msta->vif, struct ieee80211_vif, drv_priv);  + link_conf = rcu_dereference(vif->link_conf[mlink->wcid.link_id]); -+ if (!sta || !link_conf) ++ if (!link_conf)  + return -EINVAL;  /* store the info from RXD and ethhdr to avoid being overridden */